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

wmts getfeatureinfo also requires format parameter.. #10595

Closed
landryb opened this issue Oct 4, 2024 · 3 comments · Fixed by #10596 or #10606
Closed

wmts getfeatureinfo also requires format parameter.. #10595

landryb opened this issue Oct 4, 2024 · 3 comments · Fixed by #10596 or #10606

Comments

@landryb
Copy link
Collaborator

landryb commented Oct 4, 2024

Description

WMTS GetFeatureInfo against the national OGC services at https://data.geopf.fr/wmts fail because apparently it expects the FORMAT parameter, which according to my reading of the WMTS spec is mandatory.

How to reproduce

Expected Result
we should get a valid return value/feedback

Current Result

a 400 code with this ExceptionReport about missing FORMAT:

<ExceptionReport xmlns="http://www.opengis.net/ows/1.1">
<Exception exceptionCode="MissingParameterValue" >
  Parametre FORMAT absent.
</Exception>
</ExceptionReport>

adding a FORMAT=application/json parameter results in another ExceptionReport:

<ExceptionReport xmlns="http://www.opengis.net/ows/1.1">
<Exception exceptionCode="InvalidParameterValue" >
  Le format application/json n'est pas gere pour la couche ADMINEXPRESS-COG-CARTO.LATEST
</Exception>
</ExceptionReport>

which is another issue and blatantly wrong serverside, since this format is listed in the values for infoformat in https://data.geopf.fr/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities

i'll bring up that last bit to the service admins, but in my opinion and interpretation of the spec mapstore should also send the format parameter here: https://github.com/geosolutions-it/MapStore2/blob/master/web/client/utils/mapinfo/wmts.js#L97

@landryb landryb added the bug label Oct 4, 2024
@tdipisa tdipisa added this to the 2024.02.02 milestone Oct 4, 2024
@tdipisa tdipisa added investigation estimate needed BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch labels Oct 4, 2024
@tdipisa tdipisa modified the milestones: 2024.02.02, 2024.02.01 Oct 4, 2024
@landryb
Copy link
Collaborator Author

landryb commented Oct 4, 2024

after discussing with the data.geopf.fr service admins, the service has a spec-compliant behaviour:

  • style param needs to be set from a value listed in getcapabilities (eg not normal but same name as layername here, but afaict it's properly set in https://github.com/geosolutions-it/MapStore2/blob/master/web/client/utils/mapinfo/wmts.js#L98)
  • format has to be set to an image format that is supported by the wmts service (eg a value in the format list in getcapabilities)
  • infoformat has to be set to a featureinfo format that is supported for this layer (eg a value in the infoformat list in getcapabilities)
    i was mostly confused by the error message not mentioning which parameter wasnt supported

eg https://data.geopf.fr/wmts?service=WMTS&request=GetFeatureInfo&layer=ACCES.BIOMETHANE&infoformat=text/plain&style=ACCES.BIOMETHANE&tilecol=260&tilerow=182&tilematrix=9&tilematrixset=PM_6_16&i=227&j=236&format=image/png
and https://data.geopf.fr/wmts?service=WMTS&request=GetFeatureInfo&layer=ACCES.BIOMETHANE&infoformat=application/json&style=ACCES.BIOMETHANE&tilecol=260&tilerow=182&tilematrix=9&tilematrixset=PM_6_16&i=227&j=236&format=image/png

both work, first one as plain text, second one as json.. so mapstore should send the format parameter with the same value as used for a gettile request, dunno if that is accessible in that scope.

the request currently done by mapstore:
https://data.geopf.fr/wmts?service=WMTS&request=GetFeatureInfo&layer=ACCES.BIOMETHANE&infoformat=application%2Fjson&style=ACCES.BIOMETHANE&tilecol=260&tilerow=182&tilematrix=9&tilematrixset=PM_6_16&i=204&j=98

a corresponding working request:
https://data.geopf.fr/wmts?service=WMTS&request=GetFeatureInfo&layer=ACCES.BIOMETHANE&infoformat=application%2Fjson&style=ACCES.BIOMETHANE&tilecol=260&tilerow=182&tilematrix=9&tilematrixset=PM_6_16&i=204&j=98&format=image%2Fpng

@landryb
Copy link
Collaborator Author

landryb commented Oct 4, 2024

it's as simple as this:

--- a/web/client/utils/mapinfo/wmts.js
+++ b/web/client/utils/mapinfo/wmts.js
@@ -95,6 +95,7 @@ export default {
                 request: 'GetFeatureInfo',
                 layer: layer.name,
                 infoformat: props.format,
+                format: layer.format,
                 style: layer.style || '',
                 ...assign({}, params),
                 tilecol: tileCol,

but in my real testing i only get a 404 and

<ExceptionReport xmlns="http://www.opengis.net/ows/1.1">
<Exception exceptionCode="Not Found" >
  No data found
</Exception>
</ExceptionReport>

which is .. unexpected. But still, progress.

@landryb
Copy link
Collaborator Author

landryb commented Oct 4, 2024

Image

finally, it worked on the ACCES.BIOMETHANE layer. guess i needed to properly click on an existing object..

also tried with the HTML and PROPERTIES formats, all three works.

@tdipisa tdipisa linked a pull request Oct 4, 2024 that will close this issue
6 tasks
@tdipisa tdipisa assigned landryb and unassigned rowheat02 Oct 4, 2024
allyoucanmap pushed a commit that referenced this issue Oct 8, 2024
…ests (#10596)

* add missing 'FORMAT' parameter to WMTS GetFeatureInfo requests

this is required by the WMTS spec to be the same format as would
be used for a GetTile request, and this allows GFI requests to
succeed on https://data.geopf.fr/wmts.

* fix mapinfo wmts utils test
@ElenaGallo ElenaGallo self-assigned this Oct 8, 2024
allyoucanmap pushed a commit to allyoucanmap/MapStore2 that referenced this issue Oct 8, 2024
…eatureInfo requests (geosolutions-it#10596)

* add missing 'FORMAT' parameter to WMTS GetFeatureInfo requests

this is required by the WMTS spec to be the same format as would
be used for a GetTile request, and this allows GFI requests to
succeed on https://data.geopf.fr/wmts.

* fix mapinfo wmts utils test
@allyoucanmap allyoucanmap removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Oct 8, 2024
tdipisa pushed a commit that referenced this issue Oct 8, 2024
…ests (#10596) (#10606)

* add missing 'FORMAT' parameter to WMTS GetFeatureInfo requests

this is required by the WMTS spec to be the same format as would
be used for a GetTile request, and this allows GFI requests to
succeed on https://data.geopf.fr/wmts.

* fix mapinfo wmts utils test

Co-authored-by: Landry Breuil <[email protected]>
jnewmoyer pushed a commit to ngsllc/MapStore2 that referenced this issue Oct 17, 2024
* Update Changelog for version 2024.02.00 (geosolutions-it#10602)

Co-authored-by: github-actions <[email protected]>

* Bump commons-io:commons-io from 2.7 to 2.14.0 (geosolutions-it#10593)

* Removed react-confirm-button unused dependency (geosolutions-it#10495)

* Update release_steps.md (geosolutions-it#10568)

* Remove istambul loader (geosolutions-it#10491)

* Attempt to remove instambul loader

* removed also package dependency

* Apply suggestions from code review

clean

* Remove jsonpath (geosolutions-it#10494)

jsonpath is not needed. It is a dependency of geosolutions-it/patcher actually.
Having this dependency here is only confusing for dependency analyisis

* Fix geosolutions-it#10595 add missing 'FORMAT' parameter to WMTS GetFeatureInfo requests (geosolutions-it#10596)

* add missing 'FORMAT' parameter to WMTS GetFeatureInfo requests

this is required by the WMTS spec to be the same format as would
be used for a GetTile request, and this allows GFI requests to
succeed on https://data.geopf.fr/wmts.

* fix mapinfo wmts utils test

* Fix geosolutions-it#10505 Allow to specify use of proxy or cors at layer level (geosolutions-it#10526)

* fix: remove ui element for force proxy and Allow not secure layers

* fix: ajax logic changed, autoDetectCORS is set to true by default

* new central CORS util file created and used in ajax

* checking CORS before adding in common layer file

* null check on getProxyUrl

* updated individual layer considring to use proxy if needed

* avoid proxy cache to update if response is not okey

* enable user to add http url, show warning instead of error, warning text updated

* test cases updated

* fix: resolve conflicts with url check

* fixed the failed test

* review cesium layers

* include add method in model layer

* improve http check for openlayers wms layer

* fix tests

---------

Co-authored-by: allyoucanmap <[email protected]>

* Update openId.md (geosolutions-it#10610)

* Bump spring-security version to 5.7.12 (fixes geosolutions-it#10611) (geosolutions-it#10612)

somehow something in the build already drags this version, and we
end up with two conflicting versions of spring-security in the war
which results in at least failure to authenticate with basic auth.

* Visibility limits - The resolution option is not retained as Limits type geosolutions-it#10391 (geosolutions-it#10598)

* Add lib check release step (geosolutions-it#10614)

* geosolutions-it#4675 Remove unused code (geosolutions-it#10442)

* geosolutions-it#4675 Remove unused code

* remove additional code from review

* fix tests folder

* remove additional unused files

* geosolutions-it#10545: Option to disable identify popup in case of no results (geosolutions-it#10557)

* geosolutions-it#10545: Option to disable identify popup in case of no results
Description:
- handle adding an option called 'hidePopupIfNoResults' to hide the identify popup
- add unit tests
- add jsdoc

* geosolutions-it#10545: Option to disable identify popup in case of no results
Description:
- revert changes in popupSupport files for ol and leaflet + related tests files
- handle hide popup for map viewer with css for openlayers and leaflet approach
- add unit tests
- edit map-popup.less file to handle hide the popup

* geosolutions-it#10545: revert unnecessary changes

* Fix geosolutions-it#10615 removed eval from marker utils (geosolutions-it#10616)

* geosolutions-it#10545: remove marker in case no results + hover identify mode active and hideEmptyPopupOption with true (geosolutions-it#10619)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lorenzo Natali <[email protected]>
Co-authored-by: Landry Breuil <[email protected]>
Co-authored-by: RowHeat <[email protected]>
Co-authored-by: allyoucanmap <[email protected]>
Co-authored-by: mahmoud adel <[email protected]>
Co-authored-by: Matteo V. <[email protected]>
offtherailz pushed a commit that referenced this issue Oct 18, 2024
…ests (#10596)

* add missing 'FORMAT' parameter to WMTS GetFeatureInfo requests

this is required by the WMTS spec to be the same format as would
be used for a GetTile request, and this allows GFI requests to
succeed on https://data.geopf.fr/wmts.

* fix mapinfo wmts utils test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment