Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Tiles URL encoding in WMTS XML doc #937

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 0.18.4 (2024-06-26)

* fix Tiles URL encoding for WMTSCapabilities XML document

## 0.18.3 (2024-05-20)

* fix `WMTSCapabilities.xml` response for ArcMap compatibility
Expand Down
16 changes: 16 additions & 0 deletions src/titiler/core/tests/test_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import pathlib
import warnings
import xml.etree.ElementTree as ET
from dataclasses import dataclass
from enum import Enum
from io import BytesIO
Expand Down Expand Up @@ -268,6 +269,19 @@ def test_TilerFactory():
meta = parse_img(response.content)
assert meta["driver"] == "WMTS"
assert meta["crs"] == "EPSG:3857"
root = ET.fromstring(response.content)
assert root

response = client.get(
f"/WebMercatorQuad/WMTSCapabilities.xml?url={DATA_DIR}/cog.tif&bdix=1&rescale=0,1000"
)
assert response.status_code == 200
assert response.headers["content-type"] == "application/xml"
meta = parse_img(response.content)
assert meta["driver"] == "WMTS"
assert meta["crs"] == "EPSG:3857"
root = ET.fromstring(response.content)
assert root

response = client.get(
f"/WorldCRS84Quad/WMTSCapabilities.xml?url={DATA_DIR}/cog.tif&minzoom=5&maxzoom=12"
Expand All @@ -277,6 +291,8 @@ def test_TilerFactory():
meta = parse_img(response.content)
assert meta["driver"] == "WMTS"
assert str(meta["crs"]) == "OGC:CRS84"
root = ET.fromstring(response.content)
assert root

response = client.get(f"/bounds?url={DATA_DIR}/cog.tif")
assert response.status_code == 200
Expand Down
2 changes: 1 addition & 1 deletion src/titiler/core/titiler/core/templates/wmts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<TileMatrixSetLink>
<TileMatrixSet>{{ tms.id }}</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="{{ media_type }}" resourceType="tile" template="{{ tiles_endpoint }}" />
<ResourceURL format="{{ media_type }}" resourceType="tile" template="{{ tiles_endpoint | escape }}" />
</Layer>
<TileMatrixSet>
<ows:Identifier>{{ tms.id }}</ows:Identifier>
Expand Down
Loading