Search in sources :

Example 1 with Collection

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);
}
Also used : java.util(java.util) Link(io.arlas.server.core.model.Link) MixedRequest(io.arlas.server.core.model.request.MixedRequest) Path(javax.ws.rs.Path) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Feature(org.geojson.Feature) ComputationRequest(io.arlas.server.core.model.request.ComputationRequest) Collection(io.arlas.server.stac.model.Collection) MediaType(javax.ws.rs.core.MediaType) ArlasException(io.arlas.server.core.exceptions.ArlasException) ExploreService(io.arlas.server.core.services.ExploreService) FeatureCollection(org.geojson.FeatureCollection) InvalidParameterException(io.arlas.server.core.exceptions.InvalidParameterException) IntParam(io.dropwizard.jersey.params.IntParam) io.arlas.server.core.utils(io.arlas.server.core.utils) UriBuilder(javax.ws.rs.core.UriBuilder) Api(io.swagger.annotations.Api) ZoneOffset(java.time.ZoneOffset) Search(io.arlas.server.core.model.request.Search) Polygon(org.geojson.Polygon) CollectionReference(io.arlas.server.core.model.CollectionReference) CollectionReferenceService(io.arlas.server.core.services.CollectionReferenceService) GeoJsonObject(org.geojson.GeoJsonObject) ITU(com.ethlo.time.ITU) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) Instant(java.time.Instant) ComputationEnum(io.arlas.server.core.model.enumerations.ComputationEnum) io.arlas.server.stac.model(io.arlas.server.stac.model) Collectors(java.util.stream.Collectors) MD(io.arlas.server.core.model.response.MD) TimestampTypeMapper.formatDate(io.arlas.server.core.utils.TimestampTypeMapper.formatDate) DateTimeParseException(java.time.format.DateTimeParseException) OffsetDateTime(java.time.OffsetDateTime) Stream(java.util.stream.Stream) Response(javax.ws.rs.core.Response) ParseException(org.locationtech.jts.io.ParseException) STACConfiguration(io.arlas.server.core.app.STACConfiguration) Geometry(org.locationtech.jts.geom.Geometry) UriInfo(javax.ws.rs.core.UriInfo) OperatorEnum(io.arlas.server.core.model.enumerations.OperatorEnum) Collection(io.arlas.server.stac.model.Collection) FeatureCollection(org.geojson.FeatureCollection)

Aggregations

ITU (com.ethlo.time.ITU)1 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 STACConfiguration (io.arlas.server.core.app.STACConfiguration)1 ArlasException (io.arlas.server.core.exceptions.ArlasException)1 InvalidParameterException (io.arlas.server.core.exceptions.InvalidParameterException)1 CollectionReference (io.arlas.server.core.model.CollectionReference)1 Link (io.arlas.server.core.model.Link)1 ComputationEnum (io.arlas.server.core.model.enumerations.ComputationEnum)1 OperatorEnum (io.arlas.server.core.model.enumerations.OperatorEnum)1 ComputationRequest (io.arlas.server.core.model.request.ComputationRequest)1 MixedRequest (io.arlas.server.core.model.request.MixedRequest)1 Search (io.arlas.server.core.model.request.Search)1 MD (io.arlas.server.core.model.response.MD)1 CollectionReferenceService (io.arlas.server.core.services.CollectionReferenceService)1 ExploreService (io.arlas.server.core.services.ExploreService)1 io.arlas.server.core.utils (io.arlas.server.core.utils)1 TimestampTypeMapper.formatDate (io.arlas.server.core.utils.TimestampTypeMapper.formatDate)1 io.arlas.server.stac.model (io.arlas.server.stac.model)1 Collection (io.arlas.server.stac.model.Collection)1 IntParam (io.dropwizard.jersey.params.IntParam)1