Ticket #2724 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

GML format creates features with geometry = OpenLayers.Bounds

Reported by: fvanderbiest Owned by: tschaub
Priority: major Milestone: 2.10 Release
Component: Format.GML Version: SVN
Keywords: Cc:
State: Complete

Description

When parsing such a feature,

<IPLI_CLC_NAT_feature>
<gml:boundedBy>
<gml:Box srsName="EPSG:2154">
<gml:coordinates>298831.457971,6849838.066507 299138.956063,6850053.337673</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<DEPARTEMENT>Côte d&#39;Armor</DEPARTEMENT>
<OCCUPATION_DU_SOL_IPLI>Habitat individuel diffus</OCCUPATION_DU_SOL_IPLI>
<OCCUPATION_DU_SOL_CLC>Tissu urbain individuel diffus</OCCUPATION_DU_SOL_CLC>
</IPLI_CLC_NAT_feature>

... the GML format creates a feature with a geometry whose value is an OpenLayers.Bounds.

As bounds parsing is taken care of by the following block code :

var boundedByNodes = this.getElementsByTagNameNS(node, this.gmlns, 'boundedBy');
if (boundedByNodes.length === 1) {
    parser = this.parseGeometry['box']; 
    feature.bounds = parser.apply(this, [boundedByNodes[0]]);
}

... I suggest we remove "Box" from the array named "order" in the parseFeature method.

I'm not sure whether box is a valid geometry type for a feature geometry in the GML world. In case it is, we would need to modify the parseGeometrybox? method.

Attachments

patch-2724-A0.diff Download (3.2 KB) - added by elemoine 3 years ago.
requires tests
patch-2724-A1.diff Download (7.9 KB) - added by fvanderbiest 3 years ago.
patch-2724-A2.diff Download (8.8 KB) - added by elemoine 3 years ago.

Change History

Changed 3 years ago by fvanderbiest

  • state set to Needs Discussion

Changed 3 years ago by elemoine

requires tests

Changed 3 years ago by fvanderbiest

  • state changed from Needs Discussion to Review

Tests added and a minor bugfix. WMSGetFeatureInfo testing is already taken care of by existing tests.

Please review.

Changed 3 years ago by fvanderbiest

Changed 3 years ago by elemoine

Changed 3 years ago by elemoine

patch-2724-A2.diff Download adds a new test case, namely "without boundedBy Box, with Box geometry".

It also changes

var data = OpenLayers.Format.XML.prototype.read.apply(this, [test_box[0]]);

to

var xmlparser = new OpenLayers.Format.XML();
var data = xmlparser.read(test_box[0]);

The Control.WMSGetFeatureInfo, Format.WMSGetFeatureInfo, and Format.GML tests pass in FF 3.6.8, IE 7, and Chrome 5.

fvanderbiest, please change this ticket's State to Commit if you agree with my changes, and I'll commit the patch.

Changed 3 years ago by fvanderbiest

  • state changed from Review to Commit

thanks Eric.

Changed 3 years ago by elemoine

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [10614]) the old-but-still-used GML format creates features with geometries of type OpenLayers.Bounds, p=fvanderbiest, r=me (closes #2724)

Note: See TracTickets for help on using tickets.