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

Feature Request: Support for GetFeatureInfo on a WMTS layer using template from WMTS capabilities #14582

Open
mbosecke opened this issue Mar 17, 2023 · 2 comments

Comments

@mbosecke
Copy link

mbosecke commented Mar 17, 2023

I'm using Geoserver as a backend to serve WMTS layers, which are built on the frontend using "optionsFromCapabilities". Within the capabilities document, I see URL templates on how to implement GetFeatureInfo that look like this:

<ResourceURL format="text/xml" resourceType="FeatureInfo" template="https://mitchell.internal.forcorp.com/geoserver/gwc/service/wmts/rest/public:fma_simplified/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{J}/{I}?format=text/xml"/>
<ResourceURL format="text/html" resourceType="FeatureInfo" template="https://mitchell.internal.forcorp.com/geoserver/gwc/service/wmts/rest/public:fma_simplified/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{J}/{I}?format=text/html"/>
<ResourceURL format="application/json" resourceType="FeatureInfo" template="https://mitchell.internal.forcorp.com/geoserver/gwc/service/wmts/rest/public:fma_simplified/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{J}/{I}?format=application/json"/>

I would like a feature that helps build GetFeatureInfo URLs, using the templates provided from a WMTS capabilities document. I would imagine it to have the same (or similar) API as the "TileWMS.getFeatureInfoUrl" function.

It looks like these pull requests were on the right track but never completed: #2373, #3150

@mbosecke
Copy link
Author

mbosecke commented Mar 17, 2023

I've added a small bounty to this feature request in case there's anyone who can help:

https://app.bountysource.com/issues/118117964-feature-request-support-for-getfeatureinfo-on-a-wmts-layer-using-template-from-wmts-capabilities

@mike-000
Copy link
Contributor

mike-000 commented Mar 18, 2023

I don't think this would be a method of the WMTS source as it requires information not available to the source. It is however easy to deduce the url needed for an info request given the parsed capabilities, the options used to create the source and the format required for the info, together with the coordinate and resolution, in the application using existing API methods. For example replacing the WMS with WMTS in the GetFeatureInfo example https://codesandbox.io/s/getfeatureinfo-tile-forked-4418ms?file=/main.js

Handling reprojection would require the non-API ol/reproj#calculateSourceResolution method to provide the most appropriate resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants