openlayers / ol2

OpenLayers v2 - deprecated!
Other
1.48k stars 771 forks source link

ESRI WMS GetFeatureInfo not parsed #885

Open justb4 opened 11 years ago

justb4 commented 11 years ago

An old issue is back in a new form(at): http://trac.osgeo.org/openlayers/ticket/3177

It looks like ESRI has a new WMS GetFeatureInfo response for application/vnd.esri.wms_featureinfo_xml. We encountered a response format like in a Heron app (https://groups.google.com/forum/?fromgroups=#!topic/geoext-viewer-devel/-E7hbqJpRAQ):

<?xml version="1.0"?>
<FeatureInfoResponse version="1.3.0" xmlns:esri_wms="http://www.esri.com/wms"   xmlns="http://www.esri.com/wms">
<FeatureInfoCollection layername="Coastal Conditions">
<FeatureInfo>
<Field>
  <FieldName>OBJECTID</FieldName>
  <FieldValue>94</FieldValue>
</Field>
<Field>
  <FieldName>SHAPE</FieldName>
 <FieldValue>Polyline</FieldValue>
</Field>
 .
 .

See e.g. this GFI http://tinyurl.com/d7t9yu2. Although it seems that a GFI response is determined by an XSL stylesheet, so one can expect anything, I found the above format described in http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_java_help/index.html#/Customizing_a_WMS_GetFeatureInfo_response/0092000013wt000000.

In an an older version of ArcIMS using application/vnd.ogc.wms_xml returns the "FIELDS" format http://webhelp.esri.com/arcims/9.3/general/mergedprojects/wms_connect/wms_connector/get_featureinfo.htm

The problem IMO is that because of the XML-tag "FeatureInfoResponse", the response is read in 2.12 OpenLayers.Format.WMSGetFeatureInfo.read_FeatureInfoResponse(), giving 0 features.

What we probably need to do in FeatureInfoResponse() is to sniff for FeatureInfo element and parse the n/v pairs from the FieldName/FieldValue elements. (or we could ask ESRI to play more nicely with WMS GFI and support application/vnd.ogc.gml ;-)).

But ok the OGC left the GFI response format open so anything goes. I hope to find some time to supply a patch...

mpriour commented 11 years ago

I can take care if thus on Monday

mpriour commented 11 years ago

^of this

gis-rybak commented 11 years ago

Thank you for taking care of this. The WMS services created using ESRI ArcServer have the format like the following: http://arcserve.lawr.ucdavis.edu/arcgis/services/CSMW/Coastal_Conditions/MapServer/WMSServer?request=GetCapabilities&service=WMS

application/vnd.esri.wms_raw_xml application/vnd.esri.wms_featureinfo_xml application/vnd.ogc.wms_xml text/xml text/html text/plain I'm testing this service to GetFeatureInfo using application/vnd.esri.wms_featureinfo_xml in this web application: http://coastalsediment.resources.ca.gov/map/ I can get the info in XML format but not like an array ("Grid") . Thanks, Alex Rybak (gis.rybak@gmail.com)
justb4 commented 11 years ago

@mpriour not to press you, but are you planning to still take this issue and solve it/provide a pull req? If so in what timeframe? To coordinate to avoid double efforts. If you don't have time that's fine, we (from the Heron project) will plan it in.

gis-rybak commented 11 years ago

Hi Matt, were you able to work on this? Alex

mpriour commented 11 years ago

I'm actually working on it today. Some stuff cane up earlier

Matt Priour sent from my Droid RAZR On Mar 7, 2013 9:18 AM, "gis-rybak" notifications@github.com wrote:

Hi Matt, were you able to work on this? Alex

— Reply to this email directly or view it on GitHubhttps://github.com/openlayers/openlayers/issues/885#issuecomment-14565929 .

gis-rybak commented 11 years ago

Thank you, Matt! Please keep me and Just updated on the progress.

Related question: are you planning to make possible to directly get legends and feature info from ESRI REST services? Often, when people publish via AGS they forget to enable WMS. Having only REST available, is there a way to GFI and legend (of which I'm not aware)? Thanks, Alex

mprins commented 11 years ago

offtopic; @gis-rybak there is no relation between the esri geoservices rest protocol and the wms protocol, you should stick to using just one standard for a layer. WMS 1.3.0 has getMap and getFeatureInfo requests (and no getLegendGraphic), esri has /MapServer/export, /MapServer/legend and /MapServer/identify endpoints if you have an up to date server.