Ticket #1812 (closed feature: fixed)

Opened 5 years ago

Last modified 4 years ago

GetFeatureInfo GML response format parser

Reported by: mpriour Owned by: ahocevar
Priority: minor Milestone: 2.8 Release
Component: Format Version: 2.7
Keywords: GML GetFeatureInfo Format Cc:
State: Complete

Description

GetFeatureInfo responses in GML format from a number of map server / feature server applications can not be directly parsed using the current OpenLayers.Format.GML implementation, nor any of its subclasses.

The challenge, however, is that the GML GetFeatureInfo response format has no OGC schema nor any implementation guidelines from that organization. In fact, it is an optional response format. Due to the lack of standards, GML GetFeatureInfo responses can be highly variable. Therefore either a broadly generic approach to parsing is needed or numerous "flavors" of GML GetFeatureInfo format readers would need to be created.

Attachments

gml_gfi_Nov042008.patch Download (12.0 KB) - added by mpriour 5 years ago.
Patch containing contents of GML_GFI.js
GML_GFI.js Download (8.9 KB) - added by mpriour 5 years ago.
GML GetFeatureInfo Format reader
featureinfo.patch Download (26.6 KB) - added by bartvde 4 years ago.
patch from sandbox/bartvde/wmsgetfeatureinfo
wmsgetfeatureinfo.patch Download (21.5 KB) - added by ahocevar 4 years ago.
gfi.patch Download (21.7 KB) - added by tschaub 4 years ago.
parse GetFeatureInfo responses

Change History

Changed 5 years ago by mpriour

Patch containing contents of GML_GFI.js

Changed 5 years ago by mpriour

GML GetFeatureInfo Format reader

Changed 5 years ago by mpriour

I have attached my first attempt at writing a GML GetFeatureInfo response format parser. This is targeted at the default GML GetFetureInfo response from Mapserver 5. It MAY work with other WMS implementations, but has not been tested.
The attached OpenLayers.Format.GML_GFI class works well for the specific purpose and application it was developed for, but likely requires significant work and testing to be more broadly applicable and be up to full OpenLayers coding standards.

Changed 4 years ago by bartvde

Hi Matt, your code currently fails against an empty Mapserver output, e.g.:

<msGMLOutput 
	 xmlns:gml="http://www.opengis.net/gml"
	 xmlns:xlink="http://www.w3.org/1999/xlink"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</msGMLOutput>

I had to change the following for that:

            while (child && child.nodeType != 1) {
                child = child.nextSibling;
            }
            tagName = (child ? child.nodeName : '');

Changed 4 years ago by bartvde

  • state set to Review

I've been working a bit on this as well in my bartvde/wmsgetfeatureinfo sandbox, and added some tests. I've verified my Format works for ESRI, Ionic, Geoserver and Mapserver. I chose an approach whereby there are 2 specific Format classes, one for the msGMLOutput from Mapserver, and one of ESRI's FeatureInfoResponse (both ArcIMS and ArcGIS Server use this). The parser falls back on Format.GML which works fine for Ionic and Geoserver. I'll attach a patch.

Changed 4 years ago by bartvde

patch from sandbox/bartvde/wmsgetfeatureinfo

Changed 4 years ago by ahocevar

  • owner changed from tschaub to ahocevar

Changed 4 years ago by ahocevar

Thanks Bart for this contribution. Only one minor change that I made: I renamed the layerName property that the msGMLOutput parser adds to the feature to type. The reason is that we are planning to add this property to the feature anyway for multiple typename support (see #1838 and #1961).

Changed 4 years ago by ahocevar

Bart: one more change that I made: I put all readers into one class, because determining the reader from a node name is more like our readers concept than the versioned parsers concept.

Changed 4 years ago by ahocevar

Changed 4 years ago by tschaub

parse GetFeatureInfo responses

Changed 4 years ago by tschaub

  • state changed from Review to Commit

Thanks for the work on this. I think it looks good to go. The updated patch only contains minor tweaks (copyright, read_msGMLOutput always returns array, some ndoc, some array length caching).

Changed 4 years ago by ahocevar

(In [8920]) WMSGetFeatureInfo class with tests. Should have gone in with my previous commit, but forgot to svn a. (see #1812)

Changed 4 years ago by ahocevar

  • state changed from Commit to Complete

closed as of #8919 and #8920

Changed 4 years ago by ahocevar

  • status changed from new to closed
  • resolution set to fixed

closed as of r8919 and r8920 (not my day today as it seems)

Changed 4 years ago by tschaub

(In [8925]) Correcting what was the result of a patch applied twice - thanks for the catch elemoine. r8920 added the WMSGetFeatureInfo format with the class definition repeated (and slightly different). (see #1812)

Note: See TracTickets for help on using tickets.