Closed landryb closed 1 month ago
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 supportedeg 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
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.
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.
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:
adding a
FORMAT=application/json
parameter results in another 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