Ticket #3367 (closed feature: fixed)

Opened 2 years ago

Last modified 2 years ago

Automagically detect featureType and featureNS

Reported by: ahocevar Owned by: tschaub
Priority: minor Milestone: 2.12 Release
Component: Format.GML Version: 2.11 RC1
Keywords: Cc:
State: Commit

Description

With WPS, it is not always easy to figure out what the featureNS and featureType of a FeatureCollection are. This ticket suggests adding auto-detection for readers.

Attachments

openlayers-featuretypedetection.patch Download (9.3 KB) - added by ahocevar 2 years ago.
no tests yet
openlayers-3367.patch Download (11.6 KB) - added by ahocevar 2 years ago.

Change History

Changed 2 years ago by bartvde

Great, if we have this in place we can use the new Fornat.GML instead of the old one in the WMSGetFeatureInfo Format. Could we then get rid of OpenLayers.Format.GML then (or use it as an alias) or is there something still missing in the new parsers?

Changed 2 years ago by ahocevar

no tests yet

Changed 2 years ago by ahocevar

Bart, I think removing the old Format.GML is an excellent idea, but I also don't know if there is something else in there that we don't have in the new parsers. Maybe you should create a separate ticket and ask on the dev list.

Changed 2 years ago by ahocevar

  • state set to Review

Tests pass in Safari5. Thanks for any review.

Changed 2 years ago by ahocevar

Changed 2 years ago by bartvde

Looking into this one now.

Changed 2 years ago by bartvde

  • state changed from Review to Commit

Hi Andreas, this looks good, 2 minor comments/questions:

  • readNode in WFST 1.0 and 1.1 misses "return".
  • this is minor and I am not sure what the convention is, but would it not be cleaner if we filter out the third parameter of readNode before calling Format.XML's readNode, i.e. return OpenLayers.Format.XML.prototype.readNode.call(this, [node, obj]);

Relevant tests also pass in IE8 and FF4.

One thing I am still missing from the new Format.GML parser is that we need a versioned parser in between that will figure out the version (GML2 or GML3) by itself.

As a proof of concept I changed all the Format.GML tests to use GML.v2 however 13 tests are failing in that case, so to replace it would require some more work, however might be just fixing up the testcases (I see some small differences with namespaces declaration for xsi etc. missing in the old Format, it doesn't seem like anything major).

However ofcourse this is out of scope for this ticket. I'll open up tickets once this gets in.

Changed 2 years ago by ahocevar

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

(In [12110]) auto-configure featureType and featureNS. p=bartvde (closes #3367)

Changed 2 years ago by ahocevar

Thanks for the review Bart, I made both changes you suggested before I committed.

Changed 2 years ago by bartvde

Hey Andreas, thanks, I think you missed one occurrence of the readNode call (lib/OpenLayers/Format/GML/Base.js)

Changed 2 years ago by ahocevar

(In [12111]) calling the method on the superclass only with the advertised arguments. Thanks bartvde for catching this (see #3367)

Note: See TracTickets for help on using tickets.