Skip to content

Commit da74d72

Browse files
fix the wmts.xml template to work with non-epsg based CRS (#558)
1 parent e854ae1 commit da74d72

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Notes
22

3+
## 0.9.1 (2022-12-08)
4+
5+
* fix the `wmts.xml` template to work with non-epsg based CRS
6+
37
## 0.9.0 (2022-12-05)
48

59
### titiler.core

src/titiler/core/tests/test_factories.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,18 @@ def test_TilerFactory():
229229
)
230230
assert response.status_code == 200
231231
assert response.headers["content-type"] == "application/xml"
232+
meta = parse_img(response.content)
233+
assert meta["driver"] == "WMTS"
234+
assert meta["crs"] == "EPSG:3857"
235+
236+
response = client.get(
237+
f"/WorldCRS84Quad/WMTSCapabilities.xml?url={DATA_DIR}/cog.tif&minzoom=5&maxzoom=12"
238+
)
239+
assert response.status_code == 200
240+
assert response.headers["content-type"] == "application/xml"
241+
meta = parse_img(response.content)
242+
assert meta["driver"] == "WMTS"
243+
assert str(meta["crs"]) == "OGC:CRS84"
232244

233245
response = client.get(f"/bounds?url={DATA_DIR}/cog.tif")
234246
assert response.status_code == 200

src/titiler/core/titiler/core/templates/wmts.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
</Layer>
5353
<TileMatrixSet>
5454
<ows:Identifier>{{ tms.identifier }}</ows:Identifier>
55-
<ows:SupportedCRS>EPSG:{{ tms.crs.to_epsg() }}</ows:SupportedCRS>
55+
<ows:SupportedCRS>{{ tms.crs.srs }}</ows:SupportedCRS>
5656
{% for item in tileMatrix %}
5757
{{ item | safe }}
5858
{% endfor %}
5959
</TileMatrixSet>
6060
</Contents>
6161
<ServiceMetadataURL xlink:href="{{ request.url }}" />
62-
</Capabilities>
62+
</Capabilities>

0 commit comments

Comments
 (0)