|
@self.router.get( |
|
"/tiles/{tileMatrixSetId}", |
|
response_model=TileSet, |
|
response_class=JSONResponse, |
|
response_model_exclude_none=True, |
|
responses={ |
|
200: { |
|
"content": { |
|
"application/json": {}, |
|
"text/html": {}, |
|
} |
|
} |
|
}, |
|
summary="Retrieve the raster tileset metadata for the specified dataset and tiling scheme (tile matrix set).", |
|
operation_id=f"{self.operation_prefix}getTileSet", |
|
) |
|
async def tileset( |
|
request: Request, |
|
tileMatrixSetId: Annotated[ |
|
Literal[tuple(self.supported_tms.list())], |
|
Path( |
|
description="Identifier selecting one of the TileMatrixSetId supported." |
|
), |
|
], |
|
src_path=Depends(self.path_dependency), |
|
reader_params=Depends(self.reader_dependency), |
|
env=Depends(self.environment_dependency), |
|
f: Annotated[ |
|
Literal["html", "json"] | None, |
|
Query( |
|
description="Response MediaType. Defaults to endpoint's default or value defined in `accept` header." |
|
), |
|
] = None, |
|
): |
|
"""Retrieve the raster tileset metadata for the specified dataset and tiling scheme (tile matrix set).""" |
|
tms = self.supported_tms.get(tileMatrixSetId) |
|
with rasterio.Env(**env): |
|
with self.reader( |
|
src_path, tms=tms, **reader_params.as_dict() |
|
) as src_dst: |
|
bounds = src_dst.get_geographic_bounds(tms.rasterio_geographic_crs) |
|
minzoom = src_dst.minzoom |
|
maxzoom = src_dst.maxzoom |
|
|
|
collection_bbox = { |
|
"lowerLeft": [bounds[0], bounds[1]], |
|
"upperRight": [bounds[2], bounds[3]], |
|
"crs": CRS_to_uri(tms.rasterio_geographic_crs), |
|
} |
|
|
|
tilematrix_limits = tms_limits( |
|
tms, |
|
bounds, |
|
zooms=(minzoom, maxzoom), |
|
) |
titiler/src/titiler/core/titiler/core/factory.py
Lines 681 to 735 in f1faabc
kinda like #1391