Skip to content

Commit 608e1c7

Browse files
committed
fix
1 parent 49a886b commit 608e1c7

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/tests/test_stac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_stac_to_raster():
4040
"""test link to raster api."""
4141
# tilejson
4242
resp = httpx.get(
43-
f"{stac_endpoint}/collections/noaa-emergency-response/items/20200307aC0853300w361200/tilejson.json",
43+
f"{stac_endpoint}/collections/noaa-emergency-response/items/20200307aC0853300w361200/WebMercatorQuad/tilejson.json",
4444
params={"assets": "cog"},
4545
)
4646
assert resp.status_code == 307

runtimes/eoapi/stac/eoapi/stac/extensions.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ def register(self, app: FastAPI) -> None:
3333
self.router.prefix = app.state.router_prefix
3434

3535
@self.router.get(
36-
"/collections/{collection_id}/items/{item_id}/WebMercatorQuad/tilejson.json",
36+
"/collections/{collection_id}/items/{item_id}/{tileMatrixSetId}/tilejson.json",
3737
)
3838
async def tilejson(
3939
request: Request,
40-
collection_id: str = Path(description="Collection ID"),
41-
item_id: str = Path(description="Item ID"),
40+
collection_id: Annotated[str, Path(description="Collection ID")],
41+
item_id: Annotated[str, Path(description="Item ID")],
42+
tileMatrixSetId: Annotated[
43+
str,
44+
Path(
45+
description="Identifier selecting one of the TileMatrixSetId supported."
46+
),
47+
],
4248
tile_format: Optional[str] = Query(
4349
None, description="Output image type. Default is auto."
4450
),
@@ -83,7 +89,7 @@ async def tilejson(
8389
if key.lower() not in qs_key_to_remove
8490
]
8591
return RedirectResponse(
86-
f"{self.titiler_endpoint}/collections/{collection_id}/items/{item_id}/WebMercatorQuad/tilejson.json?{urlencode(qs)}"
92+
f"{self.titiler_endpoint}/collections/{collection_id}/items/{item_id}/{tileMatrixSetId}/tilejson.json?{urlencode(qs)}"
8793
)
8894

8995
@self.router.get(
@@ -97,8 +103,8 @@ async def tilejson(
97103
)
98104
async def stac_viewer(
99105
request: Request,
100-
collection_id: str = Path(description="Collection ID"),
101-
item_id: str = Path(description="Item ID"),
106+
collection_id: Annotated[str, Path(description="Collection ID")],
107+
item_id: Annotated[str, Path(description="Item ID")],
102108
):
103109
"""Get items and redirect to stac tiler."""
104110
qs = [(key, value) for (key, value) in request.query_params._list]

0 commit comments

Comments
 (0)