[OpenLayers-Dev] GML 3.2.1
Steven Ottens
steven at minst.net
Wed Jun 23 04:05:55 EDT 2010
Hi all,
The lovely family of GML has been expanded with GML 3.2.1. For some reason this version (in stead of the already marginally supported 3.1.1) is used within the INSPIRE directive in Europe. I was asked to see if OpenLayers supports it. I have asked to get a list of differences between 3.1.1 and 3.2.1, but apparently that's not that easy.
So I've hacked a bit in OpenLayers to see if it would render GML 3.2.1 features. A quick test suggested that the current 3.1.1 renderer can render 3.2.1 as well. The problem however is that GML 3.2.* has the namespace 'gml' but with a different URI (http://opengis.net/gml/3.2 - versus http://www.opengis.net/gml for GML 3.1.1). Since XML.js uses the namespaceURI to choose which reader it should use, this becomes a problem.
My (ugly) hack involved adding an extra namespace to OpenLayers\Format\WFST\v1.js (line 23):
gml32: "http://www.opengis.net/gml/3.2",
And binding the GML reader to that namespace in OpenLayers\Format\WFST\v1_1_0.js (line 66)
"gml32": OpenLayers.Format.GML.v3.prototype.readers["gml"],
(obviously a similar thing needs to be done for the writers)
This works, but it's not very elegant. It might be better to create something like OpenLayers.Format.GML.v3.2.1 which extends OpenLayers.Format.GML.v3 with the new/changed features of GML 3.2.1 (if any).
What do you guys think?
Kind regards,
Steven
More information about the Dev
mailing list