Ticket #1613 (closed feature: duplicate)

Opened 5 years ago

Last modified 4 years ago

enhance Format.GML to parse gml:boundedBy

Reported by: bartvde Owned by: tschaub
Priority: critical Milestone: 2.8 Release
Component: Format.GML Version: 2.6
Keywords: Cc:
State: Review

Description

This is e.g. handy when you want to zoom to the full featureCollection.

Attachments

ticket1613.patch Download (3.5 KB) - added by bartvde 5 years ago.
ticket1613.2.patch Download (3.6 KB) - added by bartvde 5 years ago.
updates patch which does not fail when <gml:null>missing</gml:null> is in the GML
ticket1613_gmlv2.patch Download (0.8 KB) - added by bartvde 5 years ago.
patch rewritten against OpenLayers.Format.GML.v2

Change History

Changed 5 years ago by bartvde

A problem though is that the read function currently returns an array of features, so there is not really "space" to put an extra return value. If it would return an object with an array of features, there wouldn't be an issue. But changing this will also influence Layer.GML and other code that currently uses Format.GML, so I don't know if this is acceptable.

Changed 5 years ago by crschmidt

The way we've addressed this type of requirement is to require additional options to be passed to read which say something like 'return some different type of object': so if 'read' gets a 'returnBbox: true' option, then read can return something other than a list of features.

Changed 5 years ago by bartvde

Thanks Chris, I'll take that into account when creating the patch.

Changed 5 years ago by bartvde

Changed 5 years ago by bartvde

  • state set to Review

Changed 5 years ago by crschmidt

Tim: I think you had mentioned at one point you were working on an improved GML parser. (One that didn't use so much slow getElementsByTagNameNS.) Is that the case?

Changed 5 years ago by bartvde

  • state changed from Review to Needs More Work

On the mailing list Tim pointed to this:

http://trac.openlayers.org/browser/sandbox/topp/almanac/lib/OpenLayers/Format/GML/Base.js

I'll try and update the patch to avoid getElementsByTagNameNS for the added functionality.

Changed 5 years ago by bartvde

updates patch which does not fail when <gml:null>missing</gml:null> is in the GML

Changed 5 years ago by euzuro

  • priority changed from minor to critical

Changed 5 years ago by euzuro

  • state changed from Needs More Work to Review

Changed 5 years ago by tschaub

  • milestone changed from 2.7 Release to 2.8 Release

I'm going to bump this as well. If someone else can review before the end of the week, please pull this back to 2.7.

Changed 5 years ago by bartvde

patch rewritten against OpenLayers.Format.GML.v2

Changed 5 years ago by bartvde

Okay, I've finally rewritten my patch against the OpenLayers.Format.GML.v2 parser of OL 2.7. Please review.

Example useage:

    ..
    var g =  new OpenLayers.Format.GML.v2(options);
    var features = g.read(response.responseXML || response.responseText);
    // boundedBy will contain the boundary of the whole feature collection
    // easy for zooming to the selection / collection
    console.log(g.boundedBy);
    ..

Changed 4 years ago by tschaub

(In [8809]) Adding a test to confirm that reading of boundedBy works for GML 2 as well (see #1918, #1613)

Changed 4 years ago by tschaub

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

Thanks for the patch Bart. I added support for reading boundedBy in GML 2 and 3 in r8808. I'll mark this as a duplicate of #1819. Reopen if there are issues.

Note: See TracTickets for help on using tickets.