Skip to content

Commit c7a0f51

Browse files
Merge pull request #43 from jverrydt/feat/wms-extension
WMS extension
2 parents 5c0ef70 + ff232a6 commit c7a0f51

10 files changed

Lines changed: 1288 additions & 65 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ It runs `titiler.stacapi` using Uvicorn web server.
7979
### WMTS and the Render extension
8080

8181
`titiler-stacapi` makes extensive use of the [**Render**](https://github.com/stac-extensions/render) extension, specifically at the `Collection` level.
82-
By using the render's metadata, the `/wmts` endpoint (from the `OGCWMTSFactory` factory) can populate a set of `layers` returned by the `GetCapabilities` service.
82+
By using the render's metadata, the `/wmts` endpoint (from the `OGCEndpointsFactory` factory) can populate a set of `layers` returned by the `GetCapabilities` service.
8383

8484

8585
## Contribution & Development

docs/src/custom/application_with_auth.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ from titiler.core.middleware import CacheControlMiddleware
2323
from titiler.mosaic.errors import MOSAIC_STATUS_CODES
2424
from titiler.stacapi import __version__ as titiler_stacapi_version
2525
from titiler.stacapi.dependencies import APIParams
26-
from titiler.stacapi.factory import OGCWMTSFactory
26+
from titiler.stacapi.factory import OGCEndpointsFactory
2727
from titiler.stacapi.settings import ApiSettings, STACAPISettings
2828

2929
settings = ApiSettings()
@@ -84,7 +84,7 @@ supported_tms = morecantile.TileMatrixSets({"EPSG3857": morecantile.TileMatrixSe
8484

8585
###############################################################################
8686
# OGC WMTS Endpoints
87-
wmts = OGCWMTSFactory(
87+
wmts = OGCEndpointsFactory(
8888
backend_dependency=BackendParams,
8989
supported_tms=supported_tms,
9090
)

tests/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
"""titiler.stacapi tests configuration."""
22

33
import os
4+
from typing import Any
45

56
import pytest
67
import rasterio
78
from fastapi.testclient import TestClient
9+
from rasterio.io import MemoryFile
810

911
DATA_DIR = os.path.join(os.path.dirname(__file__), "fixtures")
1012

1113

14+
def parse_img(content: bytes) -> dict[Any, Any]:
15+
"""Read tile image and return metadata."""
16+
with MemoryFile(content) as mem:
17+
with mem.open() as dst:
18+
return dst.profile
19+
20+
1221
@pytest.fixture
1322
def app(monkeypatch):
1423
"""App fixture."""

tests/test_render.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def test_render(client):
3131

3232
visual = collections_render["MAXAR_BayofBengal_Cyclone_Mocha_May_23_visual"]
3333
assert visual["bbox"]
34-
assert visual["tilematrixsets"]["WebMercatorQuad"]
3534
assert visual["time"]
3635
assert visual["render"]["asset_bidx"]
3736

0 commit comments

Comments
 (0)