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

Fallback to layer id and use urn identifier in tms supportedCRS #18

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Changes from 1 commit
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: 2 additions & 2 deletions titiler/stacapi/templates/wmts-getcapabilities_1.0.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<Contents>
{% for layer in layers %}
<Layer>
<ows:Title>{{ layer.title }}</ows:Title>
<ows:Title>{{ layer.title or layer.id }}</ows:Title>
<ows:WGS84BoundingBox>
<ows:LowerCorner>{{ layer.bbox[0] }} {{ layer.bbox[1] }}</ows:LowerCorner>
<ows:UpperCorner>{{ layer.bbox[2] }} {{ layer.bbox[3] }}</ows:UpperCorner>
Expand Down Expand Up @@ -113,7 +113,7 @@
{% for tms in tilematrixsets %}
<TileMatrixSet>
<ows:Identifier>{{ tms.id }}</ows:Identifier>
<ows:SupportedCRS>{{ tms.crs.srs }}</ows:SupportedCRS>
<ows:SupportedCRS>urn:ogc:def:crs:{{ tms.id }}</ows:SupportedCRS>
Copy link
Member

@vincentsarago vincentsarago Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not valid, a TMS identifier is not always a valid SRS/CRS string

what we could do is use tms.crs.to_epsg()

{% if tms.crs.to_epsg() %}
<ows:SupportedCRS>urn:ogc:def:crs:epsg::{{tms.crs.to_epsg()}}</ows:SupportedCRS>
{% else %}
<ows:SupportedCRS>{{ tms.crs.srs.replace("http://www.opengis.net/def/", "urn:ogc:def:").replace("/", ":")}} </ows:SupportedCRS>
{% endif %}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, modified it in PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't have tests for the WMTS endpoint so could you tests those change before we merge?

{% for matrix in tms %}
<TileMatrix>
<ows:Identifier>{{ matrix.id }}</ows:Identifier>
Expand Down