geomoose / gm3

GeoMoose 3.0 Development. Please submit pull requests to the 'main' branch.
https://www.geomoose.org
MIT License
58 stars 60 forks source link

ESRI WMS service ignores INFO_FORMAT=application/vnd.ogc.gml #845

Open tchaddad opened 11 months ago

tchaddad commented 11 months ago

The US Fish & Wildlife Service hosts a WMS service for the National Wetlands Inventory (served by an ArcServer) here: https://fwspublicservices.wim.usgs.gov/wetlandsmapservice/services/Wetlands/MapServer/WMSServer?request=GetCapabilities&service=WMS

The supported INFO_FORMATS for GetFeatureInfo on this server are:

For the WMS service, a GetFeatureInfo query from Geomoose looks like this: https://fwspublicservices.wim.usgs.gov/wetlandsmapservice/services/Wetlands/MapServer/WMSServer?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image/png&TRANSPARENT=true&QUERY_LAYERS=1&LAYERS=1&INFO_FORMAT=application/vnd.ogc.gml&FEATURE_COUNT=1000&X=50&Y=50&SRS=EPSG:3857&STYLES=&WIDTH=101&HEIGHT=101&BBOX=-13839639.247702612,5356713.648169963,-13839336.004626645,5357016.891245931

However the server doesn't support the requested INFO_FORMAT, so it ignores it, and instead returns an ESRI-specific XML format.

If the same request is made with INFO_FORMAT set to geojson, the server will return the requested format: https://fwspublicservices.wim.usgs.gov/wetlandsmapservice/services/Wetlands/MapServer/WMSServer?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&QUERY_LAYERS=1&LAYERS=1&FEATURE_COUNT=1000&X=50&Y=50&SRS=EPSG:3857&STYLES=&WIDTH=101&HEIGHT=101&BBOX=-13839108.477351086,5363070.542952579,-13838970.344240246,5363208.676063421&INFO_FORMAT=application/geojson

GeoMoose should probably support asking for a format that the server advertises that it supports.

I think this means it would be good if GeoMoose allowed setting a param of INFO_FORMAT for WMS map sources, so that the default can be overwritten for servers that do not advertise "application/vnd.ogc.gml"

brentfraser commented 11 months ago

You could set it in the mapsource's param in the mapbook, but the problem is GM does not have the code in place to handle the returned geojson (or the other formats) [yet].

tchaddad commented 11 months ago

Yep, I had tried setting the map-source param, but it seemed to be ignored (?), and instead the default value of "application/vnd.ogc.gml" is sent to the server.

This is what I had set:

<param name="INFO_FORMAT" value="application/geojson" />

Mostly I just wanted to record this for now, so that we could come back to it...

brentfraser commented 11 months ago

Some similar info at #546