Search in sources :

Example 1 with TileMatrixSetRepository

use of de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetRepository in project ldproxy by interactive-instruments.

the class EndpointTileMatrixSets method getTileMatrixSets.

/**
 * retrieve all available tile matrix sets
 *
 * @return all tile matrix sets in a json array or an HTML view
 */
@GET
public Response getTileMatrixSets(@Context OgcApi api, @Context ApiRequestContext requestContext) {
    if (!isEnabledForApi(api.getData()))
        throw new NotFoundException("Tile matrix sets are not available in this API.");
    ImmutableSet<TileMatrixSet> tmsSet = getPathParameters(extensionRegistry, api.getData(), "/tileMatrixSets/{tileMatrixSetId}").stream().filter(param -> param.getName().equalsIgnoreCase("tileMatrixSetId")).findFirst().map(param -> param.getValues(api.getData()).stream().map(tileMatrixSetRepository::get).filter(Optional::isPresent).map(Optional::get).collect(ImmutableSet.toImmutableSet())).orElse(ImmutableSet.of());
    TileMatrixSetsQueriesHandler.QueryInputTileMatrixSets queryInput = new ImmutableQueryInputTileMatrixSets.Builder().from(getGenericQueryInput(api.getData())).tileMatrixSets(tmsSet).build();
    return queryHandler.handle(TileMatrixSetsQueriesHandler.Query.TILE_MATRIX_SETS, queryInput, requestContext);
}
Also used : Endpoint(de.ii.ogcapi.foundation.domain.Endpoint) PathParam(javax.ws.rs.PathParam) ExtensionConfiguration(de.ii.ogcapi.foundation.domain.ExtensionConfiguration) GET(javax.ws.rs.GET) OgcApiPathParameter(de.ii.ogcapi.foundation.domain.OgcApiPathParameter) Path(javax.ws.rs.Path) LoggerFactory(org.slf4j.LoggerFactory) Singleton(javax.inject.Singleton) ImmutableOgcApiResourceSet(de.ii.ogcapi.foundation.domain.ImmutableOgcApiResourceSet) AutoBind(com.github.azahnen.dagger.annotations.AutoBind) TilesConfiguration(de.ii.ogcapi.tiles.domain.TilesConfiguration) Inject(javax.inject.Inject) ConformanceClass(de.ii.ogcapi.foundation.domain.ConformanceClass) ImmutableList(com.google.common.collect.ImmutableList) TileMatrixSetRepository(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetRepository) ExtensionRegistry(de.ii.ogcapi.foundation.domain.ExtensionRegistry) TileMatrixSetsQueriesHandler(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetsQueriesHandler) ApiOperation(de.ii.ogcapi.foundation.domain.ApiOperation) OgcApiQueryParameter(de.ii.ogcapi.foundation.domain.OgcApiQueryParameter) ImmutableQueryInputTileMatrixSet(de.ii.ogcapi.tiles.domain.tileMatrixSet.ImmutableQueryInputTileMatrixSet) ApiRequestContext(de.ii.ogcapi.foundation.domain.ApiRequestContext) ImmutableOgcApiResourceAuxiliary(de.ii.ogcapi.foundation.domain.ImmutableOgcApiResourceAuxiliary) ImmutableSet(com.google.common.collect.ImmutableSet) TileMatrixSetsFormatExtension(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetsFormatExtension) Context(javax.ws.rs.core.Context) Logger(org.slf4j.Logger) FeaturesCoreProviders(de.ii.ogcapi.features.core.domain.FeaturesCoreProviders) OgcApi(de.ii.ogcapi.foundation.domain.OgcApi) HttpMethods(de.ii.ogcapi.foundation.domain.HttpMethods) FeatureProvider2(de.ii.xtraplatform.features.domain.FeatureProvider2) NotFoundException(javax.ws.rs.NotFoundException) ImmutableApiEndpointDefinition(de.ii.ogcapi.foundation.domain.ImmutableApiEndpointDefinition) ApiEndpointDefinition(de.ii.ogcapi.foundation.domain.ApiEndpointDefinition) List(java.util.List) Response(javax.ws.rs.core.Response) ImmutableQueryInputTileMatrixSets(de.ii.ogcapi.tiles.domain.tileMatrixSet.ImmutableQueryInputTileMatrixSets) OgcApiDataV2(de.ii.ogcapi.foundation.domain.OgcApiDataV2) TileMatrixSet(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSet) Optional(java.util.Optional) FormatExtension(de.ii.ogcapi.foundation.domain.FormatExtension) ImmutableQueryInputTileMatrixSet(de.ii.ogcapi.tiles.domain.tileMatrixSet.ImmutableQueryInputTileMatrixSet) TileMatrixSet(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSet) Optional(java.util.Optional) TileMatrixSetsQueriesHandler(de.ii.ogcapi.tiles.domain.tileMatrixSet.TileMatrixSetsQueriesHandler) NotFoundException(javax.ws.rs.NotFoundException) ImmutableQueryInputTileMatrixSets(de.ii.ogcapi.tiles.domain.tileMatrixSet.ImmutableQueryInputTileMatrixSets) GET(javax.ws.rs.GET)

Aggregations

AutoBind (com.github.azahnen.dagger.annotations.AutoBind)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 FeaturesCoreProviders (de.ii.ogcapi.features.core.domain.FeaturesCoreProviders)1 ApiEndpointDefinition (de.ii.ogcapi.foundation.domain.ApiEndpointDefinition)1 ApiOperation (de.ii.ogcapi.foundation.domain.ApiOperation)1 ApiRequestContext (de.ii.ogcapi.foundation.domain.ApiRequestContext)1 ConformanceClass (de.ii.ogcapi.foundation.domain.ConformanceClass)1 Endpoint (de.ii.ogcapi.foundation.domain.Endpoint)1 ExtensionConfiguration (de.ii.ogcapi.foundation.domain.ExtensionConfiguration)1 ExtensionRegistry (de.ii.ogcapi.foundation.domain.ExtensionRegistry)1 FormatExtension (de.ii.ogcapi.foundation.domain.FormatExtension)1 HttpMethods (de.ii.ogcapi.foundation.domain.HttpMethods)1 ImmutableApiEndpointDefinition (de.ii.ogcapi.foundation.domain.ImmutableApiEndpointDefinition)1 ImmutableOgcApiResourceAuxiliary (de.ii.ogcapi.foundation.domain.ImmutableOgcApiResourceAuxiliary)1 ImmutableOgcApiResourceSet (de.ii.ogcapi.foundation.domain.ImmutableOgcApiResourceSet)1 OgcApi (de.ii.ogcapi.foundation.domain.OgcApi)1 OgcApiDataV2 (de.ii.ogcapi.foundation.domain.OgcApiDataV2)1 OgcApiPathParameter (de.ii.ogcapi.foundation.domain.OgcApiPathParameter)1 OgcApiQueryParameter (de.ii.ogcapi.foundation.domain.OgcApiQueryParameter)1