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);
}
Aggregations