developmentseed / titiler

Build your own Raster dynamic map tile services
https://developmentseed.org/titiler/
MIT License
755 stars 156 forks source link

Add `use_epsg` parameter to WMTS endpoint #782

Closed gadomski closed 5 months ago

gadomski commented 6 months ago

What I am changing

Adds a use_epsg parameter to the WMTS endpoint, which changes the format of the CRS for the tile matrix set. This is needed to support ArcMap, which doesn't like the opengis.net-style CRS in the SupportedCRS.

Also adds an escape to the URLs in the WMTS template, as multiple query parameters were breaking XML parsing b/c of the &.

How you can test it

I've added unit tests. To manually test, you can hit a titiler WMTS endpoint with the parameter, e.g. http://localhost:8000/cog/WMTSCapabilities.xml?url=your-url-here&use_epsg=true and check out the SupportedCRS field.

Related Issues

Manual testing with ArcMap

This is an ArcMap WMTS configuration against titiler endpoint without any modifications:

Screenshot 2024-02-20 115746

The layer doesn't load:

Screenshot 2024-02-20 115759

Adding the use_epsg parameter:

Screenshot 2024-02-20 120041

It works!

Screenshot 2024-02-20 115916

vincentsarago commented 5 months ago

thanks a lot @gadomski, really nice PR 🙏