Search in sources :

Example 1 with OgcApi

use of de.ii.ogcapi.foundation.domain.OgcApi in project ldproxy by interactive-instruments.

the class TilesQueriesHandlerImpl method getTileSetResponse.

private Response getTileSetResponse(QueryInputTileSet queryInput, ApiRequestContext requestContext) {
    OgcApi api = requestContext.getApi();
    OgcApiDataV2 apiData = api.getData();
    String tileMatrixSetId = queryInput.getTileMatrixSetId();
    Optional<String> collectionId = queryInput.getCollectionId();
    String definitionPath = queryInput.getPath();
    String path = collectionId.map(value -> definitionPath.replace("{collectionId}", value)).orElse(definitionPath).replace("{tileMatrixSetId}", tileMatrixSetId);
    TileSetFormatExtension outputFormat = api.getOutputFormat(TileSetFormatExtension.class, requestContext.getMediaType(), path, collectionId).orElseThrow(() -> new NotAcceptableException(MessageFormat.format("The requested media type ''{0}'' is not supported for this resource.", requestContext.getMediaType())));
    List<TileFormatExtension> tileFormats = extensionRegistry.getExtensionsForType(TileFormatExtension.class).stream().filter(format -> collectionId.map(s -> format.isApplicable(apiData, s, definitionPath)).orElseGet(() -> format.isApplicable(apiData, definitionPath))).collect(Collectors.toUnmodifiableList());
    DataType dataType = tileFormats.stream().map(TileFormatExtension::getDataType).findAny().orElseThrow(() -> new NotFoundException("No encoding found for this tile set."));
    final TilesLinkGenerator tilesLinkGenerator = new TilesLinkGenerator();
    List<Link> links = tilesLinkGenerator.generateTileSetLinks(requestContext.getUriCustomizer(), requestContext.getMediaType(), requestContext.getAlternateMediaTypes(), tileFormats, i18n, requestContext.getLanguage());
    MinMax zoomLevels = queryInput.getZoomLevels();
    List<Double> center = queryInput.getCenter();
    TileSet tileset = TilesHelper.buildTileSet(api, getTileMatrixSetById(tileMatrixSetId), zoomLevels, center, collectionId, dataType, links, Optional.of(requestContext.getUriCustomizer().copy()), crsTransformerFactory, limitsGenerator, providers, entityRegistry);
    Date lastModified = getLastModified(queryInput, requestContext.getApi());
    EntityTag etag = !outputFormat.getMediaType().type().equals(MediaType.TEXT_HTML_TYPE) || (collectionId.isEmpty() ? apiData.getExtension(HtmlConfiguration.class) : apiData.getExtension(HtmlConfiguration.class, collectionId.get())).map(HtmlConfiguration::getSendEtags).orElse(false) ? getEtag(tileset, TileSet.FUNNEL, outputFormat) : null;
    Response.ResponseBuilder response = evaluatePreconditions(requestContext, lastModified, etag);
    if (Objects.nonNull(response))
        return response.build();
    return prepareSuccessResponse(requestContext, queryInput.getIncludeLinkHeader() ? links : null, lastModified, etag, queryInput.getCacheControl().orElse(null), queryInput.getExpires().orElse(null), null, true, String.format("%s.%s", tileset.getTileMatrixSetId(), outputFormat.getMediaType().fileExtension())).entity(outputFormat.getTileSetEntity(tileset, apiData, collectionId, requestContext)).build();
}
Also used : Date(java.util.Date) Link(de.ii.ogcapi.foundation.domain.Link) LoggerFactory(org.slf4j.LoggerFactory) TileSetFormatExtension(de.ii.ogcapi.tiles.domain.TileSetFormatExtension) EpsgCrs(de.ii.xtraplatform.crs.domain.EpsgCrs) TileSetsFormatExtension(de.ii.ogcapi.tiles.domain.TileSetsFormatExtension) ApiMediaType(de.ii.ogcapi.foundation.domain.ApiMediaType) MediaType(javax.ws.rs.core.MediaType) ByteArrayInputStream(java.io.ByteArrayInputStream) Map(java.util.Map) TileMatrixSetRepository(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetRepository) Tile(de.ii.ogcapi.tiles.domain.Tile) ExtensionRegistry(de.ii.ogcapi.foundation.domain.ExtensionRegistry) OutputStreamToByteConsumer(de.ii.xtraplatform.streams.domain.OutputStreamToByteConsumer) PersistentEntity(de.ii.xtraplatform.store.domain.entities.PersistentEntity) HtmlConfiguration(de.ii.ogcapi.html.domain.HtmlConfiguration) ApiRequestContext(de.ii.ogcapi.foundation.domain.ApiRequestContext) FeaturesCoreProviders(de.ii.ogcapi.features.core.domain.FeaturesCoreProviders) ImmutableMap(com.google.common.collect.ImmutableMap) FeatureTokenEncoder(de.ii.xtraplatform.features.domain.FeatureTokenEncoder) OgcApi(de.ii.ogcapi.foundation.domain.OgcApi) Codelist(de.ii.xtraplatform.codelists.domain.Codelist) DefaultLinksGenerator(de.ii.ogcapi.foundation.domain.DefaultLinksGenerator) CompletionException(java.util.concurrent.CompletionException) StreamingOutput(javax.ws.rs.core.StreamingOutput) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) ImmutableFeatureTransformationContextTiles(de.ii.ogcapi.tiles.domain.ImmutableFeatureTransformationContextTiles) NotFoundException(javax.ws.rs.NotFoundException) Objects(java.util.Objects) List(java.util.List) TilesQueriesHandler(de.ii.ogcapi.tiles.domain.TilesQueriesHandler) Builder(de.ii.ogcapi.tiles.domain.ImmutableTileSets.Builder) Response(javax.ws.rs.core.Response) OgcApiDataV2(de.ii.ogcapi.foundation.domain.OgcApiDataV2) TileMatrixSet(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSet) CrsTransformerFactory(de.ii.xtraplatform.crs.domain.CrsTransformerFactory) ByteStreams(com.google.common.io.ByteStreams) Sink(de.ii.xtraplatform.streams.domain.Reactive.Sink) Optional(java.util.Optional) WebApplicationException(javax.ws.rs.WebApplicationException) FeatureTypeConfigurationOgcApi(de.ii.ogcapi.foundation.domain.FeatureTypeConfigurationOgcApi) EntityRegistry(de.ii.xtraplatform.store.domain.entities.EntityRegistry) QueryHandler(de.ii.ogcapi.foundation.domain.QueryHandler) FeatureQuery(de.ii.xtraplatform.features.domain.FeatureQuery) TileFormatWithQuerySupportExtension(de.ii.ogcapi.tiles.domain.TileFormatWithQuerySupportExtension) ByteArrayOutputStream(java.io.ByteArrayOutputStream) CrsTransformer(de.ii.xtraplatform.crs.domain.CrsTransformer) QueryInput(de.ii.ogcapi.foundation.domain.QueryInput) PropertyTransformations(de.ii.xtraplatform.features.domain.transform.PropertyTransformations) HashMap(java.util.HashMap) Singleton(javax.inject.Singleton) TileSet(de.ii.ogcapi.tiles.domain.TileSet) LogContext(de.ii.xtraplatform.base.domain.LogContext) DataType(de.ii.ogcapi.tiles.domain.TileSet.DataType) AutoBind(com.github.azahnen.dagger.annotations.AutoBind) MessageFormat(java.text.MessageFormat) Inject(javax.inject.Inject) ClientBuilder(javax.ws.rs.client.ClientBuilder) TileMatrixSetLimitsGenerator(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetLimitsGenerator) SQLException(java.sql.SQLException) ImmutableList(com.google.common.collect.ImmutableList) QueriesHandler(de.ii.ogcapi.foundation.domain.QueriesHandler) ImmutableTileSets(de.ii.ogcapi.tiles.domain.ImmutableTileSets) FeatureTransformationContextTiles(de.ii.ogcapi.tiles.domain.FeatureTransformationContextTiles) TileCache(de.ii.ogcapi.tiles.domain.TileCache) NotAcceptableException(javax.ws.rs.NotAcceptableException) Logger(org.slf4j.Logger) MinMax(de.ii.ogcapi.tiles.domain.MinMax) I18n(de.ii.ogcapi.foundation.domain.I18n) IOException(java.io.IOException) FeatureStream(de.ii.xtraplatform.features.domain.FeatureStream) EntityTag(javax.ws.rs.core.EntityTag) FeatureProvider2(de.ii.xtraplatform.features.domain.FeatureProvider2) StaticTileProviderStore(de.ii.ogcapi.tiles.domain.StaticTileProviderStore) FeaturesCoreConfiguration(de.ii.ogcapi.features.core.domain.FeaturesCoreConfiguration) SinkReduced(de.ii.xtraplatform.streams.domain.Reactive.SinkReduced) ServerErrorException(javax.ws.rs.ServerErrorException) ResultReduced(de.ii.xtraplatform.features.domain.FeatureStream.ResultReduced) TileSets(de.ii.ogcapi.tiles.domain.TileSets) TileFormatExtension(de.ii.ogcapi.tiles.domain.TileFormatExtension) WebTarget(javax.ws.rs.client.WebTarget) Comparator(java.util.Comparator) InputStream(java.io.InputStream) TileFormatExtension(de.ii.ogcapi.tiles.domain.TileFormatExtension) OgcApi(de.ii.ogcapi.foundation.domain.OgcApi) FeatureTypeConfigurationOgcApi(de.ii.ogcapi.foundation.domain.FeatureTypeConfigurationOgcApi) NotFoundException(javax.ws.rs.NotFoundException) MinMax(de.ii.ogcapi.tiles.domain.MinMax) TileSet(de.ii.ogcapi.tiles.domain.TileSet) Date(java.util.Date) OgcApiDataV2(de.ii.ogcapi.foundation.domain.OgcApiDataV2) Response(javax.ws.rs.core.Response) NotAcceptableException(javax.ws.rs.NotAcceptableException) DataType(de.ii.ogcapi.tiles.domain.TileSet.DataType) EntityTag(javax.ws.rs.core.EntityTag) TileSetFormatExtension(de.ii.ogcapi.tiles.domain.TileSetFormatExtension) Link(de.ii.ogcapi.foundation.domain.Link)

Example 2 with OgcApi

use of de.ii.ogcapi.foundation.domain.OgcApi in project ldproxy by interactive-instruments.

the class TilesQueriesHandlerImpl method getMultiLayerTileResponse.

private Response getMultiLayerTileResponse(QueryInputTileMultiLayer queryInput, ApiRequestContext requestContext) {
    OgcApi api = requestContext.getApi();
    OgcApiDataV2 apiData = api.getData();
    Tile multiLayerTile = queryInput.getTile();
    List<String> collectionIds = multiLayerTile.getCollectionIds();
    Map<String, FeatureQuery> queryMap = queryInput.getQueryMap();
    Map<String, Tile> singleLayerTileMap = queryInput.getSingleLayerTileMap();
    FeatureProvider2 featureProvider = multiLayerTile.getFeatureProvider().get();
    TileMatrixSet tileMatrixSet = multiLayerTile.getTileMatrixSet();
    int tileLevel = multiLayerTile.getTileLevel();
    int tileRow = multiLayerTile.getTileRow();
    int tileCol = multiLayerTile.getTileCol();
    if (!(multiLayerTile.getOutputFormat() instanceof TileFormatWithQuerySupportExtension))
        throw new RuntimeException(String.format("Unexpected tile format without query support. Found: %s", multiLayerTile.getOutputFormat().getClass().getSimpleName()));
    TileFormatWithQuerySupportExtension outputFormat = (TileFormatWithQuerySupportExtension) multiLayerTile.getOutputFormat();
    // process parameters and generate query
    Optional<CrsTransformer> crsTransformer = Optional.empty();
    EpsgCrs targetCrs = tileMatrixSet.getCrs();
    if (featureProvider.supportsCrs()) {
        EpsgCrs sourceCrs = featureProvider.crs().getNativeCrs();
        crsTransformer = crsTransformerFactory.getTransformer(sourceCrs, targetCrs);
    }
    List<Link> links = new DefaultLinksGenerator().generateLinks(requestContext.getUriCustomizer(), requestContext.getMediaType(), requestContext.getAlternateMediaTypes(), i18n, requestContext.getLanguage());
    Map<String, ByteArrayOutputStream> byteArrayMap = new HashMap<>();
    for (String collectionId : collectionIds) {
        // TODO limitation of the current model: all layers have to come from the same feature provider and use the same CRS
        Tile tile = singleLayerTileMap.get(collectionId);
        if (!multiLayerTile.getTemporary()) {
            // use cached tile
            try {
                Optional<InputStream> tileContent = tileCache.getTile(tile);
                if (tileContent.isPresent()) {
                    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
                    ByteStreams.copy(tileContent.get(), buffer);
                    byteArrayMap.put(collectionId, buffer);
                    continue;
                }
            } catch (SQLException | IOException e) {
            // could not read the cache, generate the tile
            }
        }
        String featureTypeId = apiData.getCollections().get(collectionId).getExtension(FeaturesCoreConfiguration.class).map(cfg -> cfg.getFeatureType().orElse(collectionId)).orElse(collectionId);
        FeatureQuery query = queryMap.get(collectionId);
        ImmutableFeatureTransformationContextTiles transformationContext;
        try {
            transformationContext = new ImmutableFeatureTransformationContextTiles.Builder().api(api).apiData(apiData).featureSchema(featureProvider.getData().getTypes().get(featureTypeId)).tile(tile).tileCache(tileCache).collectionId(collectionId).ogcApiRequest(requestContext).crsTransformer(crsTransformer).codelists(entityRegistry.getEntitiesForType(Codelist.class).stream().collect(Collectors.toMap(PersistentEntity::getId, c -> c))).defaultCrs(queryInput.getDefaultCrs()).links(links).isFeatureCollection(true).fields(query.getFields()).limit(query.getLimit()).offset(0).i18n(i18n).outputStream(new OutputStreamToByteConsumer()).build();
        } catch (Exception e) {
            throw new RuntimeException("Error building the tile transformation context.", e);
        }
        Optional<FeatureTokenEncoder<?>> encoder = outputFormat.getFeatureEncoder(transformationContext);
        if (outputFormat.supportsFeatureQuery() && encoder.isPresent()) {
            FeatureStream featureStream = featureProvider.queries().getFeatureStream(query);
            ResultReduced<byte[]> result = generateTile(featureStream, encoder.get(), transformationContext, outputFormat);
            if (result.isSuccess()) {
                byte[] bytes = result.reduced();
                ByteArrayOutputStream buffer = new ByteArrayOutputStream(bytes.length);
                buffer.write(bytes, 0, bytes.length);
                byteArrayMap.put(collectionId, buffer);
            }
        } else {
            throw new NotAcceptableException(MessageFormat.format("The requested media type {0} cannot be generated, because it does not support streaming.", requestContext.getMediaType().type()));
        }
    }
    TileFormatWithQuerySupportExtension.MultiLayerTileContent result;
    try {
        result = outputFormat.combineSingleLayerTilesToMultiLayerTile(tileMatrixSet, singleLayerTileMap, byteArrayMap);
    } catch (IOException e) {
        throw new RuntimeException("Error accessing the tile cache.", e);
    }
    // try to write/update tile in cache, if all collections have been processed
    if (result.isComplete) {
        try {
            tileCache.storeTile(multiLayerTile, result.byteArray);
        } catch (Throwable e) {
            String msg = "Failure to write the multi-layer file of tile {}/{}/{}/{} in dataset '{}', format '{}' to the cache";
            LogContext.errorAsInfo(LOGGER, e, msg, tileMatrixSet.getId(), tileLevel, tileRow, tileCol, api.getId(), outputFormat.getExtension());
        }
    }
    Date lastModified = null;
    EntityTag etag = getEtag(result.byteArray);
    Response.ResponseBuilder response = evaluatePreconditions(requestContext, lastModified, etag);
    if (Objects.nonNull(response))
        return response.build();
    return prepareSuccessResponse(requestContext, queryInput.getIncludeLinkHeader() ? links : null, lastModified, etag, queryInput.getCacheControl().orElse(null), queryInput.getExpires().orElse(null), null, true, String.format("%s_%d_%d_%d.%s", tileMatrixSet.getId(), tileLevel, tileRow, tileCol, outputFormat.getMediaType().fileExtension())).entity(result.byteArray).build();
}
Also used : Date(java.util.Date) Link(de.ii.ogcapi.foundation.domain.Link) LoggerFactory(org.slf4j.LoggerFactory) TileSetFormatExtension(de.ii.ogcapi.tiles.domain.TileSetFormatExtension) EpsgCrs(de.ii.xtraplatform.crs.domain.EpsgCrs) TileSetsFormatExtension(de.ii.ogcapi.tiles.domain.TileSetsFormatExtension) ApiMediaType(de.ii.ogcapi.foundation.domain.ApiMediaType) MediaType(javax.ws.rs.core.MediaType) ByteArrayInputStream(java.io.ByteArrayInputStream) Map(java.util.Map) TileMatrixSetRepository(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetRepository) Tile(de.ii.ogcapi.tiles.domain.Tile) ExtensionRegistry(de.ii.ogcapi.foundation.domain.ExtensionRegistry) OutputStreamToByteConsumer(de.ii.xtraplatform.streams.domain.OutputStreamToByteConsumer) PersistentEntity(de.ii.xtraplatform.store.domain.entities.PersistentEntity) HtmlConfiguration(de.ii.ogcapi.html.domain.HtmlConfiguration) ApiRequestContext(de.ii.ogcapi.foundation.domain.ApiRequestContext) FeaturesCoreProviders(de.ii.ogcapi.features.core.domain.FeaturesCoreProviders) ImmutableMap(com.google.common.collect.ImmutableMap) FeatureTokenEncoder(de.ii.xtraplatform.features.domain.FeatureTokenEncoder) OgcApi(de.ii.ogcapi.foundation.domain.OgcApi) Codelist(de.ii.xtraplatform.codelists.domain.Codelist) DefaultLinksGenerator(de.ii.ogcapi.foundation.domain.DefaultLinksGenerator) CompletionException(java.util.concurrent.CompletionException) StreamingOutput(javax.ws.rs.core.StreamingOutput) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) ImmutableFeatureTransformationContextTiles(de.ii.ogcapi.tiles.domain.ImmutableFeatureTransformationContextTiles) NotFoundException(javax.ws.rs.NotFoundException) Objects(java.util.Objects) List(java.util.List) TilesQueriesHandler(de.ii.ogcapi.tiles.domain.TilesQueriesHandler) Builder(de.ii.ogcapi.tiles.domain.ImmutableTileSets.Builder) Response(javax.ws.rs.core.Response) OgcApiDataV2(de.ii.ogcapi.foundation.domain.OgcApiDataV2) TileMatrixSet(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSet) CrsTransformerFactory(de.ii.xtraplatform.crs.domain.CrsTransformerFactory) ByteStreams(com.google.common.io.ByteStreams) Sink(de.ii.xtraplatform.streams.domain.Reactive.Sink) Optional(java.util.Optional) WebApplicationException(javax.ws.rs.WebApplicationException) FeatureTypeConfigurationOgcApi(de.ii.ogcapi.foundation.domain.FeatureTypeConfigurationOgcApi) EntityRegistry(de.ii.xtraplatform.store.domain.entities.EntityRegistry) QueryHandler(de.ii.ogcapi.foundation.domain.QueryHandler) FeatureQuery(de.ii.xtraplatform.features.domain.FeatureQuery) TileFormatWithQuerySupportExtension(de.ii.ogcapi.tiles.domain.TileFormatWithQuerySupportExtension) ByteArrayOutputStream(java.io.ByteArrayOutputStream) CrsTransformer(de.ii.xtraplatform.crs.domain.CrsTransformer) QueryInput(de.ii.ogcapi.foundation.domain.QueryInput) PropertyTransformations(de.ii.xtraplatform.features.domain.transform.PropertyTransformations) HashMap(java.util.HashMap) Singleton(javax.inject.Singleton) TileSet(de.ii.ogcapi.tiles.domain.TileSet) LogContext(de.ii.xtraplatform.base.domain.LogContext) DataType(de.ii.ogcapi.tiles.domain.TileSet.DataType) AutoBind(com.github.azahnen.dagger.annotations.AutoBind) MessageFormat(java.text.MessageFormat) Inject(javax.inject.Inject) ClientBuilder(javax.ws.rs.client.ClientBuilder) TileMatrixSetLimitsGenerator(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetLimitsGenerator) SQLException(java.sql.SQLException) ImmutableList(com.google.common.collect.ImmutableList) QueriesHandler(de.ii.ogcapi.foundation.domain.QueriesHandler) ImmutableTileSets(de.ii.ogcapi.tiles.domain.ImmutableTileSets) FeatureTransformationContextTiles(de.ii.ogcapi.tiles.domain.FeatureTransformationContextTiles) TileCache(de.ii.ogcapi.tiles.domain.TileCache) NotAcceptableException(javax.ws.rs.NotAcceptableException) Logger(org.slf4j.Logger) MinMax(de.ii.ogcapi.tiles.domain.MinMax) I18n(de.ii.ogcapi.foundation.domain.I18n) IOException(java.io.IOException) FeatureStream(de.ii.xtraplatform.features.domain.FeatureStream) EntityTag(javax.ws.rs.core.EntityTag) FeatureProvider2(de.ii.xtraplatform.features.domain.FeatureProvider2) StaticTileProviderStore(de.ii.ogcapi.tiles.domain.StaticTileProviderStore) FeaturesCoreConfiguration(de.ii.ogcapi.features.core.domain.FeaturesCoreConfiguration) SinkReduced(de.ii.xtraplatform.streams.domain.Reactive.SinkReduced) ServerErrorException(javax.ws.rs.ServerErrorException) ResultReduced(de.ii.xtraplatform.features.domain.FeatureStream.ResultReduced) TileSets(de.ii.ogcapi.tiles.domain.TileSets) TileFormatExtension(de.ii.ogcapi.tiles.domain.TileFormatExtension) WebTarget(javax.ws.rs.client.WebTarget) Comparator(java.util.Comparator) InputStream(java.io.InputStream) Codelist(de.ii.xtraplatform.codelists.domain.Codelist) FeatureStream(de.ii.xtraplatform.features.domain.FeatureStream) HashMap(java.util.HashMap) SQLException(java.sql.SQLException) OgcApi(de.ii.ogcapi.foundation.domain.OgcApi) FeatureTypeConfigurationOgcApi(de.ii.ogcapi.foundation.domain.FeatureTypeConfigurationOgcApi) FeatureProvider2(de.ii.xtraplatform.features.domain.FeatureProvider2) PersistentEntity(de.ii.xtraplatform.store.domain.entities.PersistentEntity) FeatureQuery(de.ii.xtraplatform.features.domain.FeatureQuery) OutputStreamToByteConsumer(de.ii.xtraplatform.streams.domain.OutputStreamToByteConsumer) DefaultLinksGenerator(de.ii.ogcapi.foundation.domain.DefaultLinksGenerator) CrsTransformer(de.ii.xtraplatform.crs.domain.CrsTransformer) EntityTag(javax.ws.rs.core.EntityTag) ImmutableFeatureTransformationContextTiles(de.ii.ogcapi.tiles.domain.ImmutableFeatureTransformationContextTiles) TileMatrixSet(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSet) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) Tile(de.ii.ogcapi.tiles.domain.Tile) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) CompletionException(java.util.concurrent.CompletionException) NotFoundException(javax.ws.rs.NotFoundException) WebApplicationException(javax.ws.rs.WebApplicationException) SQLException(java.sql.SQLException) NotAcceptableException(javax.ws.rs.NotAcceptableException) IOException(java.io.IOException) ServerErrorException(javax.ws.rs.ServerErrorException) Date(java.util.Date) OgcApiDataV2(de.ii.ogcapi.foundation.domain.OgcApiDataV2) Response(javax.ws.rs.core.Response) FeatureTokenEncoder(de.ii.xtraplatform.features.domain.FeatureTokenEncoder) EpsgCrs(de.ii.xtraplatform.crs.domain.EpsgCrs) NotAcceptableException(javax.ws.rs.NotAcceptableException) TileFormatWithQuerySupportExtension(de.ii.ogcapi.tiles.domain.TileFormatWithQuerySupportExtension) Link(de.ii.ogcapi.foundation.domain.Link)

Example 3 with OgcApi

use of de.ii.ogcapi.foundation.domain.OgcApi in project ldproxy by interactive-instruments.

the class TileSetsFormatHtml method getTileSetsEntity.

@Override
public Object getTileSetsEntity(TileSets tiles, Optional<String> collectionId, OgcApi api, ApiRequestContext requestContext) {
    String rootTitle = i18n.get("root", requestContext.getLanguage());
    String collectionsTitle = i18n.get("collectionsTitle", requestContext.getLanguage());
    String tilesTitle = i18n.get("tilesTitle", requestContext.getLanguage());
    URICustomizer resourceUri = requestContext.getUriCustomizer().copy().clearParameters();
    final List<NavigationDTO> breadCrumbs = collectionId.isPresent() ? new ImmutableList.Builder<NavigationDTO>().add(new NavigationDTO(rootTitle, resourceUri.copy().removeLastPathSegments(api.getData().getSubPath().size() + 3).toString())).add(new NavigationDTO(api.getData().getLabel(), resourceUri.copy().removeLastPathSegments(3).toString())).add(new NavigationDTO(collectionsTitle, resourceUri.copy().removeLastPathSegments(2).toString())).add(new NavigationDTO(api.getData().getCollections().get(collectionId.get()).getLabel(), resourceUri.copy().removeLastPathSegments(1).toString())).add(new NavigationDTO(tilesTitle)).build() : new ImmutableList.Builder<NavigationDTO>().add(new NavigationDTO(rootTitle, resourceUri.copy().removeLastPathSegments(api.getData().getSubPath().size() + 1).toString())).add(new NavigationDTO(api.getData().getLabel(), resourceUri.copy().removeLastPathSegments(1).toString())).add(new NavigationDTO(tilesTitle)).build();
    Optional<HtmlConfiguration> htmlConfig = collectionId.isPresent() ? api.getData().getExtension(HtmlConfiguration.class, collectionId.get()) : api.getData().getExtension(HtmlConfiguration.class);
    Map<String, TileMatrixSet> tileMatrixSets = tileMatrixSetRepository.getAll();
    Optional<TilesConfiguration> tilesConfig = collectionId.isEmpty() ? api.getData().getExtension(TilesConfiguration.class) : api.getData().getExtension(TilesConfiguration.class, collectionId.get());
    MapClient.Type mapClientType = tilesConfig.map(TilesConfiguration::getMapClientType).orElse(MapClient.Type.MAP_LIBRE);
    String serviceUrl = new URICustomizer(servicesUri).ensureLastPathSegments(api.getData().getSubPath().toArray(String[]::new)).toString();
    String styleUrl = htmlConfig.map(cfg -> cfg.getStyle(tilesConfig.map(TilesConfiguration::getStyle), collectionId, serviceUrl)).orElse(null);
    boolean removeZoomLevelConstraints = tilesConfig.map(TilesConfiguration::getRemoveZoomLevelConstraints).orElse(false);
    return new TileSetsView(api.getData(), tiles, collectionId, api.getSpatialExtent(collectionId), api.getTemporalExtent(collectionId), tileMatrixSets, breadCrumbs, requestContext.getStaticUrlPrefix(), mapClientType, styleUrl, removeZoomLevelConstraints, htmlConfig.orElseThrow(), isNoIndexEnabledForApi(api.getData()), requestContext.getUriCustomizer(), i18n, requestContext.getLanguage());
}
Also used : ImmutableApiMediaTypeContent(de.ii.ogcapi.foundation.domain.ImmutableApiMediaTypeContent) TileSetsFormatExtension(de.ii.ogcapi.tiles.domain.TileSetsFormatExtension) Singleton(javax.inject.Singleton) AutoBind(com.github.azahnen.dagger.annotations.AutoBind) ApiMediaType(de.ii.ogcapi.foundation.domain.ApiMediaType) TilesConfiguration(de.ii.ogcapi.tiles.domain.TilesConfiguration) Inject(javax.inject.Inject) ImmutableApiMediaType(de.ii.ogcapi.foundation.domain.ImmutableApiMediaType) MediaType(javax.ws.rs.core.MediaType) COLLECTION_ID_PATTERN(de.ii.ogcapi.collections.domain.AbstractPathParameterCollectionId.COLLECTION_ID_PATTERN) ImmutableList(com.google.common.collect.ImmutableList) Map(java.util.Map) TileMatrixSetRepository(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetRepository) AppContext(de.ii.xtraplatform.base.domain.AppContext) URI(java.net.URI) NavigationDTO(de.ii.ogcapi.html.domain.NavigationDTO) HtmlConfiguration(de.ii.ogcapi.html.domain.HtmlConfiguration) ApiMediaTypeContent(de.ii.ogcapi.foundation.domain.ApiMediaTypeContent) ApiRequestContext(de.ii.ogcapi.foundation.domain.ApiRequestContext) TileSetsView(de.ii.ogcapi.tiles.domain.TileSetsView) I18n(de.ii.ogcapi.foundation.domain.I18n) OgcApi(de.ii.ogcapi.foundation.domain.OgcApi) URICustomizer(de.ii.ogcapi.foundation.domain.URICustomizer) MapClient(de.ii.ogcapi.html.domain.MapClient) List(java.util.List) StringSchema(io.swagger.v3.oas.models.media.StringSchema) TileSets(de.ii.ogcapi.tiles.domain.TileSets) OgcApiDataV2(de.ii.ogcapi.foundation.domain.OgcApiDataV2) TileMatrixSet(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSet) Optional(java.util.Optional) ServicesContext(de.ii.xtraplatform.services.domain.ServicesContext) TileMatrixSet(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSet) NavigationDTO(de.ii.ogcapi.html.domain.NavigationDTO) HtmlConfiguration(de.ii.ogcapi.html.domain.HtmlConfiguration) ImmutableList(com.google.common.collect.ImmutableList) URICustomizer(de.ii.ogcapi.foundation.domain.URICustomizer) TilesConfiguration(de.ii.ogcapi.tiles.domain.TilesConfiguration) TileSetsView(de.ii.ogcapi.tiles.domain.TileSetsView) MapClient(de.ii.ogcapi.html.domain.MapClient)

Example 4 with OgcApi

use of de.ii.ogcapi.foundation.domain.OgcApi in project ldproxy by interactive-instruments.

the class TilesHelper method buildTileSet.

// TODO: move to TileSet as static of()
/**
 * generate the tile set metadata according to the OGC Tile Matrix Set standard (version 2.0.0, draft from June 2021)
 * @param api the API
 * @param tileMatrixSet the tile matrix set
 * @param zoomLevels the range of zoom levels
 * @param center the center point
 * @param collectionId the collection, empty = all collections in the dataset
 * @param dataType vector, map or coverage
 * @param links links to include in the object
 * @param uriCustomizer optional URI of the resource
 * @param limitsGenerator helper to generate the limits for each zoom level based on the bbox of the data
 * @param providers helper to access feature providers
 * @return the tile set metadata
 */
public static TileSet buildTileSet(OgcApi api, TileMatrixSet tileMatrixSet, MinMax zoomLevels, List<Double> center, Optional<String> collectionId, TileSet.DataType dataType, List<Link> links, Optional<URICustomizer> uriCustomizer, CrsTransformerFactory crsTransformerFactory, TileMatrixSetLimitsGenerator limitsGenerator, FeaturesCoreProviders providers, EntityRegistry entityRegistry) {
    OgcApiDataV2 apiData = api.getData();
    Builder builder = ImmutableTileSet.builder().dataType(dataType);
    builder.tileMatrixSetId(tileMatrixSet.getId());
    if (tileMatrixSet.getURI().isPresent())
        builder.tileMatrixSetURI(tileMatrixSet.getURI().get().toString());
    else
        builder.tileMatrixSet(tileMatrixSet.getTileMatrixSetData());
    uriCustomizer.ifPresent(uriCustomizer1 -> builder.tileMatrixSetDefinition(uriCustomizer1.removeLastPathSegments(collectionId.isPresent() ? 3 : 1).clearParameters().ensureLastPathSegments("tileMatrixSets", tileMatrixSet.getId()).toString()));
    if (Objects.isNull(zoomLevels))
        builder.tileMatrixSetLimits(ImmutableList.of());
    else
        builder.tileMatrixSetLimits(collectionId.isPresent() ? limitsGenerator.getCollectionTileMatrixSetLimits(api, collectionId.get(), tileMatrixSet, zoomLevels) : limitsGenerator.getTileMatrixSetLimits(api, tileMatrixSet, zoomLevels));
    try {
        BoundingBox boundingBox = api.getSpatialExtent(collectionId).orElse(tileMatrixSet.getBoundingBoxCrs84(crsTransformerFactory));
        builder.boundingBox(ImmutableTilesBoundingBox.builder().lowerLeft(BigDecimal.valueOf(boundingBox.getXmin()).setScale(7, RoundingMode.HALF_UP), BigDecimal.valueOf(boundingBox.getYmin()).setScale(7, RoundingMode.HALF_UP)).upperRight(BigDecimal.valueOf(boundingBox.getXmax()).setScale(7, RoundingMode.HALF_UP), BigDecimal.valueOf(boundingBox.getYmax()).setScale(7, RoundingMode.HALF_UP)).crs(OgcCrs.CRS84.toUriString()).build());
    } catch (CrsTransformationException e) {
    // ignore, just skip the boundingBox
    }
    if ((Objects.nonNull(zoomLevels) && zoomLevels.getDefault().isPresent()) || !center.isEmpty()) {
        ImmutableTilePoint.Builder builder2 = new ImmutableTilePoint.Builder();
        if (Objects.nonNull(zoomLevels))
            zoomLevels.getDefault().ifPresent(def -> builder2.tileMatrix(String.valueOf(def)));
        if (!center.isEmpty())
            builder2.coordinates(center);
        builder.centerPoint(builder2.build());
    }
    // prepare a map with the JSON schemas of the feature collections used in the style
    JsonSchemaCache schemas = new SchemaCacheTileSet(() -> entityRegistry.getEntitiesForType(Codelist.class));
    Map<String, JsonSchemaDocument> schemaMap = collectionId.isPresent() ? apiData.getCollectionData(collectionId.get()).filter(collectionData -> {
        Optional<TilesConfiguration> config = collectionData.getExtension(TilesConfiguration.class);
        return collectionData.getEnabled() && config.isPresent() && config.get().isEnabled();
    }).map(collectionData -> {
        Optional<FeatureSchema> schema = providers.getFeatureSchema(apiData, collectionData);
        if (schema.isPresent())
            return ImmutableMap.of(collectionId.get(), schemas.getSchema(schema.get(), apiData, collectionData, Optional.empty()));
        return null;
    }).filter(Objects::nonNull).orElse(ImmutableMap.of()) : apiData.getCollections().entrySet().stream().filter(entry -> {
        Optional<TilesConfiguration> config = entry.getValue().getExtension(TilesConfiguration.class);
        return entry.getValue().getEnabled() && config.isPresent() && config.get().isMultiCollectionEnabled();
    }).map(entry -> {
        Optional<FeatureSchema> schema = providers.getFeatureSchema(apiData, entry.getValue());
        if (schema.isPresent())
            return new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), schemas.getSchema(schema.get(), apiData, entry.getValue(), Optional.empty()));
        return null;
    }).filter(Objects::nonNull).collect(ImmutableMap.toImmutableMap(Map.Entry::getKey, Map.Entry::getValue));
    // TODO: replace with SchemaDeriverTileLayers
    schemaMap.entrySet().stream().forEach(entry -> {
        String collectionId2 = entry.getKey();
        FeatureTypeConfigurationOgcApi collectionData = apiData.getCollections().get(collectionId2);
        JsonSchemaDocument schema = entry.getValue();
        ImmutableTileLayer.Builder builder2 = ImmutableTileLayer.builder().id(collectionId2).title(collectionData.getLabel()).description(collectionData.getDescription()).dataType(dataType);
        collectionData.getExtension(TilesConfiguration.class).map(config -> config.getZoomLevelsDerived().get(tileMatrixSet.getId())).ifPresent(minmax -> builder2.minTileMatrix(String.valueOf(minmax.getMin())).maxTileMatrix(String.valueOf(minmax.getMax())));
        final JsonSchema geometry = schema.getProperties().get("geometry");
        if (Objects.nonNull(geometry)) {
            String geomAsString = geometry.toString();
            boolean point = geomAsString.contains("GeoJSON Point") || geomAsString.contains("GeoJSON MultiPoint");
            boolean line = geomAsString.contains("GeoJSON LineString") || geomAsString.contains("GeoJSON MultiLineString");
            boolean polygon = geomAsString.contains("GeoJSON Polygon") || geomAsString.contains("GeoJSON MultiPolygon");
            if (point && !line && !polygon)
                builder2.geometryType(TileLayer.GeometryType.points);
            else if (!point && line && !polygon)
                builder2.geometryType(TileLayer.GeometryType.lines);
            else if (!point && !line && polygon)
                builder2.geometryType(TileLayer.GeometryType.polygons);
        }
        final JsonSchemaObject properties = (JsonSchemaObject) schema.getProperties().get("properties");
        builder2.propertiesSchema(ImmutableJsonSchemaObject.builder().required(properties.getRequired()).properties(properties.getProperties()).patternProperties(properties.getPatternProperties()).build());
        builder.addLayers(builder2.build());
    });
    builder.links(links);
    return builder.build();
}
Also used : ImmutableTileSet(de.ii.ogcapi.tiles.domain.ImmutableTileSet) SimpleFeatureGeometry(de.ii.xtraplatform.geometries.domain.SimpleFeatureGeometry) CrsTransformationException(de.ii.xtraplatform.crs.domain.CrsTransformationException) Link(de.ii.ogcapi.foundation.domain.Link) LoggerFactory(org.slf4j.LoggerFactory) EpsgCrs(de.ii.xtraplatform.crs.domain.EpsgCrs) JsonSchemaObject(de.ii.ogcapi.features.core.domain.JsonSchemaObject) VectorLayer(de.ii.ogcapi.tiles.domain.VectorLayer) TileLayer(de.ii.ogcapi.tiles.domain.TileLayer) BigDecimal(java.math.BigDecimal) JsonSchemaDocument(de.ii.ogcapi.features.core.domain.JsonSchemaDocument) Locale(java.util.Locale) Map(java.util.Map) JsonSchemaCache(de.ii.ogcapi.features.core.domain.JsonSchemaCache) FeatureSchema(de.ii.xtraplatform.features.domain.FeatureSchema) RoundingMode(java.math.RoundingMode) FeaturesCoreProviders(de.ii.ogcapi.features.core.domain.FeaturesCoreProviders) ImmutableMap(com.google.common.collect.ImmutableMap) ImmutableVectorLayer(de.ii.ogcapi.tiles.domain.ImmutableVectorLayer) OgcApi(de.ii.ogcapi.foundation.domain.OgcApi) Codelist(de.ii.xtraplatform.codelists.domain.Codelist) Collectors(java.util.stream.Collectors) TilePoint(de.ii.ogcapi.tiles.domain.TilePoint) Objects(java.util.Objects) List(java.util.List) OgcApiDataV2(de.ii.ogcapi.foundation.domain.OgcApiDataV2) TileMatrixSet(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSet) CrsTransformerFactory(de.ii.xtraplatform.crs.domain.CrsTransformerFactory) Optional(java.util.Optional) BoundingBox(de.ii.xtraplatform.crs.domain.BoundingBox) FeatureTypeConfigurationOgcApi(de.ii.ogcapi.foundation.domain.FeatureTypeConfigurationOgcApi) EntityRegistry(de.ii.xtraplatform.store.domain.entities.EntityRegistry) TileMatrixSetLimits(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetLimits) CrsTransformer(de.ii.xtraplatform.crs.domain.CrsTransformer) TileSet(de.ii.ogcapi.tiles.domain.TileSet) AtomicReference(java.util.concurrent.atomic.AtomicReference) TilesConfiguration(de.ii.ogcapi.tiles.domain.TilesConfiguration) ImmutableTileLayer(de.ii.ogcapi.tiles.domain.ImmutableTileLayer) ImmutableTilePoint(de.ii.ogcapi.tiles.domain.ImmutableTilePoint) TileMatrixSetLimitsGenerator(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetLimitsGenerator) SchemaBase(de.ii.xtraplatform.features.domain.SchemaBase) ImmutableList(com.google.common.collect.ImmutableList) OgcCrs(de.ii.xtraplatform.crs.domain.OgcCrs) ImmutableFields(de.ii.ogcapi.tiles.domain.ImmutableFields) Builder(de.ii.ogcapi.tiles.domain.ImmutableTileSet.Builder) Logger(org.slf4j.Logger) ImmutableJsonSchemaObject(de.ii.ogcapi.features.core.domain.ImmutableJsonSchemaObject) MinMax(de.ii.ogcapi.tiles.domain.MinMax) TilesBoundingBox(de.ii.ogcapi.tiles.domain.tileMatrixSet.TilesBoundingBox) URICustomizer(de.ii.ogcapi.foundation.domain.URICustomizer) FeaturesCoreConfiguration(de.ii.ogcapi.features.core.domain.FeaturesCoreConfiguration) GeoJsonConfiguration(de.ii.ogcapi.features.geojson.domain.GeoJsonConfiguration) JsonSchema(de.ii.ogcapi.features.core.domain.JsonSchema) ImmutableTilesBoundingBox(de.ii.ogcapi.tiles.domain.tileMatrixSet.ImmutableTilesBoundingBox) AbstractMap(java.util.AbstractMap) SchemaInfo(de.ii.ogcapi.features.core.domain.SchemaInfo) Codelist(de.ii.xtraplatform.codelists.domain.Codelist) Builder(de.ii.ogcapi.tiles.domain.ImmutableTileSet.Builder) JsonSchema(de.ii.ogcapi.features.core.domain.JsonSchema) TilesConfiguration(de.ii.ogcapi.tiles.domain.TilesConfiguration) ImmutableTilePoint(de.ii.ogcapi.tiles.domain.ImmutableTilePoint) FeatureTypeConfigurationOgcApi(de.ii.ogcapi.foundation.domain.FeatureTypeConfigurationOgcApi) ImmutableTileLayer(de.ii.ogcapi.tiles.domain.ImmutableTileLayer) BoundingBox(de.ii.xtraplatform.crs.domain.BoundingBox) TilesBoundingBox(de.ii.ogcapi.tiles.domain.tileMatrixSet.TilesBoundingBox) ImmutableTilesBoundingBox(de.ii.ogcapi.tiles.domain.tileMatrixSet.ImmutableTilesBoundingBox) JsonSchemaDocument(de.ii.ogcapi.features.core.domain.JsonSchemaDocument) Optional(java.util.Optional) OgcApiDataV2(de.ii.ogcapi.foundation.domain.OgcApiDataV2) JsonSchemaCache(de.ii.ogcapi.features.core.domain.JsonSchemaCache) CrsTransformationException(de.ii.xtraplatform.crs.domain.CrsTransformationException) Objects(java.util.Objects) JsonSchemaObject(de.ii.ogcapi.features.core.domain.JsonSchemaObject) ImmutableJsonSchemaObject(de.ii.ogcapi.features.core.domain.ImmutableJsonSchemaObject)

Example 5 with OgcApi

use of de.ii.ogcapi.foundation.domain.OgcApi in project ldproxy by interactive-instruments.

the class QueriesHandlerStylesImpl method getStyleMetadataResponse.

private Response getStyleMetadataResponse(QueryInputStyle queryInput, ApiRequestContext requestContext) {
    OgcApi api = requestContext.getApi();
    OgcApiDataV2 apiData = api.getData();
    Optional<String> collectionId = queryInput.getCollectionId();
    StyleMetadata metadata = styleRepository.getStyleMetadata(apiData, collectionId, queryInput.getStyleId(), requestContext);
    StyleMetadataFormatExtension format = styleRepository.getStyleMetadataFormatStream(apiData, collectionId).filter(f -> requestContext.getMediaType().matches(f.getMediaType().type())).findAny().orElseThrow(() -> new NotAcceptableException(MessageFormat.format("The requested media type ''{0}'' is not supported, the following media types are available: {1}", requestContext.getMediaType(), String.join(", ", styleRepository.getStyleMetadataFormatStream(apiData, collectionId).map(f -> f.getMediaType().type().toString()).collect(Collectors.toUnmodifiableList())))));
    Date lastModified = styleRepository.getStyleLastModified(apiData, collectionId, queryInput.getStyleId());
    EntityTag etag = !format.getMediaType().type().equals(MediaType.TEXT_HTML_TYPE) || (collectionId.isEmpty() ? apiData.getExtension(HtmlConfiguration.class) : apiData.getExtension(HtmlConfiguration.class, collectionId.get())).map(HtmlConfiguration::getSendEtags).orElse(false) ? getEtag(metadata, StyleMetadata.FUNNEL, format) : null;
    Response.ResponseBuilder response = evaluatePreconditions(requestContext, lastModified, etag);
    if (Objects.nonNull(response))
        return response.build();
    return prepareSuccessResponse(requestContext, queryInput.getIncludeLinkHeader() ? metadata.getLinks() : null, lastModified, etag, queryInput.getCacheControl().orElse(null), queryInput.getExpires().orElse(null), null, true, String.format("%s.metadata.%s", queryInput.getStyleId(), format.getMediaType().fileExtension())).entity(format.getStyleMetadataEntity(metadata, apiData, collectionId, requestContext)).build();
}
Also used : OgcApiDataV2(de.ii.ogcapi.foundation.domain.OgcApiDataV2) QueryHandler(de.ii.ogcapi.foundation.domain.QueryHandler) Date(java.util.Date) StyleRepository(de.ii.ogcapi.styles.domain.StyleRepository) Link(de.ii.ogcapi.foundation.domain.Link) QueryInput(de.ii.ogcapi.foundation.domain.QueryInput) Singleton(javax.inject.Singleton) AutoBind(com.github.azahnen.dagger.annotations.AutoBind) ApiMediaType(de.ii.ogcapi.foundation.domain.ApiMediaType) MessageFormat(java.text.MessageFormat) Inject(javax.inject.Inject) MediaType(javax.ws.rs.core.MediaType) Map(java.util.Map) ExtensionRegistry(de.ii.ogcapi.foundation.domain.ExtensionRegistry) HtmlConfiguration(de.ii.ogcapi.html.domain.HtmlConfiguration) ApiRequestContext(de.ii.ogcapi.foundation.domain.ApiRequestContext) NotAcceptableException(javax.ws.rs.NotAcceptableException) ImmutableMap(com.google.common.collect.ImmutableMap) I18n(de.ii.ogcapi.foundation.domain.I18n) OgcApi(de.ii.ogcapi.foundation.domain.OgcApi) DefaultLinksGenerator(de.ii.ogcapi.foundation.domain.DefaultLinksGenerator) Instant(java.time.Instant) EntityTag(javax.ws.rs.core.EntityTag) Collectors(java.util.stream.Collectors) StyleMetadataFormatExtension(de.ii.ogcapi.styles.domain.StyleMetadataFormatExtension) QueriesHandlerStyles(de.ii.ogcapi.styles.domain.QueriesHandlerStyles) Objects(java.util.Objects) StylesheetContent(de.ii.ogcapi.styles.domain.StylesheetContent) List(java.util.List) StyleMetadata(de.ii.ogcapi.styles.domain.StyleMetadata) StylesFormatExtension(de.ii.ogcapi.styles.domain.StylesFormatExtension) Response(javax.ws.rs.core.Response) OgcApiDataV2(de.ii.ogcapi.foundation.domain.OgcApiDataV2) Optional(java.util.Optional) StyleFormatExtension(de.ii.ogcapi.styles.domain.StyleFormatExtension) Styles(de.ii.ogcapi.styles.domain.Styles) Response(javax.ws.rs.core.Response) StyleMetadataFormatExtension(de.ii.ogcapi.styles.domain.StyleMetadataFormatExtension) StyleMetadata(de.ii.ogcapi.styles.domain.StyleMetadata) NotAcceptableException(javax.ws.rs.NotAcceptableException) OgcApi(de.ii.ogcapi.foundation.domain.OgcApi) EntityTag(javax.ws.rs.core.EntityTag) Date(java.util.Date)

Aggregations

OgcApi (de.ii.ogcapi.foundation.domain.OgcApi)53 OgcApiDataV2 (de.ii.ogcapi.foundation.domain.OgcApiDataV2)47 AutoBind (com.github.azahnen.dagger.annotations.AutoBind)40 Optional (java.util.Optional)40 Inject (javax.inject.Inject)40 Singleton (javax.inject.Singleton)40 List (java.util.List)35 Map (java.util.Map)33 Objects (java.util.Objects)33 Response (javax.ws.rs.core.Response)32 Collectors (java.util.stream.Collectors)30 ImmutableMap (com.google.common.collect.ImmutableMap)29 ApiRequestContext (de.ii.ogcapi.foundation.domain.ApiRequestContext)28 MediaType (javax.ws.rs.core.MediaType)28 ExtensionRegistry (de.ii.ogcapi.foundation.domain.ExtensionRegistry)27 MessageFormat (java.text.MessageFormat)27 NotAcceptableException (javax.ws.rs.NotAcceptableException)26 ImmutableList (com.google.common.collect.ImmutableList)25 FeatureTypeConfigurationOgcApi (de.ii.ogcapi.foundation.domain.FeatureTypeConfigurationOgcApi)25 I18n (de.ii.ogcapi.foundation.domain.I18n)25