use of io.arlas.server.stac.model.Collection in project ARLAS-server by gisaia.
the class StacRESTService method getCollection.
protected Collection getCollection(CollectionReference collectionReference, UriInfo uriInfo) throws ArlasException {
// https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#link-object
List<StacLink> cLinks = new ArrayList<>();
cLinks.add(getRootLink(uriInfo));
// TODO
cLinks.add(getRawLink("TODO", "licence"));
cLinks.add(getLink(uriInfo, "collections/" + collectionReference.collectionName, "self", MediaType.APPLICATION_JSON));
cLinks.add(getLink(uriInfo, "collections/" + collectionReference.collectionName + "/items", "items", "application/geo+json"));
// https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#collection-fields
return new Collection().id(collectionReference.collectionName).stacVersion(configuration.stacVersion).stacExtensions(// TODO optional
new ArrayList<>()).title(collectionReference.params.dublinCoreElementName.title).description(collectionReference.params.dublinCoreElementName.description).keywords(collectionReference.params.inspire.keywords.stream().map(k -> k.value).collect(Collectors.toList())).license(// TODO *required*
"proprietary").extent(new Extent().spatial(getSpatialExtent(collectionReference)).temporal(getTemporalExtent(collectionReference))).links(cLinks);
}
Aggregations