OpenLayers OpenLayers

Ticket #1546 (new feature)

Opened 7 months ago

Last modified 3 months ago

Format.GML: introduce geometryType

Reported by: bartvde Assigned to: tschaub
Priority: critical Milestone: 2.8 Release
Component: Format.GML Version: 2.6
Keywords: Cc:
State: Needs More Work

Description

Currently in parseFeature the parser loops over all possible geometry types, but if a client already knows the geometry type, this is a bit of a waste. In my test it took about 200 ms less time on this loop for 100 features.

Would it be an idea to introduce a geometryType APIProperty, so people knowing the geometryType can set it on the format?

Attachments

ticket1546.patch (1.3 kB) - added by bartvde on 05/14/08 05:24:22.
patch implementing geometryType on Format.GML
gml.patch (4.9 kB) - added by tschaub on 09/02/08 14:54:28.
add geometryTypes (non-api) property

Change History

05/14/08 05:24:22 changed by bartvde

  • attachment ticket1546.patch added.

patch implementing geometryType on Format.GML

05/14/08 05:25:49 changed by bartvde

  • keywords set to review.

Ofcourse this will only work for GML files which don't have multiple geometry types. But I think an application developer will figure that out themselves if they use it.

05/14/08 09:08:15 changed by bartvde

  • milestone set to 2.7 Release.

06/21/08 10:39:16 changed by crschmidt

  • keywords deleted.
  • state set to Review.

07/28/08 15:17:00 changed by euzuro

  • priority changed from minor to critical.

07/30/08 10:53:10 changed by euzuro

  • state changed from Review to Needs More Work.

See #1639

09/02/08 14:54:28 changed by tschaub

  • attachment gml.patch added.

add geometryTypes (non-api) property

09/02/08 15:00:15 changed by tschaub

  • milestone changed from 2.7 Release to 2.8 Release.

Oh, the goodness of tests. I don't think the original patch does what it is intended to do. Features are still created even if geometryType is set. These features just have undefined geometry.

I think a better solution would be to have a geometryTypes array (as I included in my patch). I also don't think we need to throw this in the API this close to a release.

Anyway, this one needs more work. Bart, thanks for the patch. Please include tests to demonstrate that the changes do what you expect if you'd like to push this for a future release.

09/02/08 15:02:37 changed by tschaub

Actually, perhaps this was known (that it doesn't really stop feature parsing) - but I think it is confusing. If we add a geometryTypes filter, then the parser should only parse features with those geometry types.