[OpenLayers-Dev] GML 3.2.1

Steven Ottens steven at minst.net
Tue Jun 29 08:17:41 EDT 2010


Hi all,

For those who do want support for GML 3.2.1 but don't want to hack OpenLayers, here is an override function you can use (thanks to BartvE) 

OpenLayers.Util.extend(OpenLayers.Format.WFST.v1_1_0.prototype.namespaces,
{gml32: "http://www.opengis.net/gml/3.2"});
OpenLayers.Util.extend(OpenLayers.Format.WFST.v1_1_0.prototype.readers,
{"gml32": OpenLayers.Format.GML.v3.prototype.readers["gml"], });

Steven

On Jun 23, 2010, at 10:05 AM, Steven Ottens wrote:

> 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
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev





More information about the Dev mailing list