[OpenLayers-Users] OpenLayers.Format.WFS question/issue

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Mon Mar 10 11:48:15 EDT 2008


Hi Steve,

namespace prefixes (please note the *prefix*, not the namespace itself) can
be anything, that's perfectly valid and up to the implementation.

I think any implementation that assumes a fixed namespace prefix is bound to
fail somewhere ....

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl


--------- Oorspronkelijk bericht --------
Van: Stephen Woodbridge <woodbri at swoodbridge.com>
Naar: openlayers user list <users at openlayers.org>
Onderwerp: [OpenLayers-Users] OpenLayers.Format.WFS question/issue
Datum: 10/03/08 13:38

> Hi all,
> 
> I admit up front that this inquiry might partly be my ignorance on the 
> subject, but when OpenLayers.Format.WFS serializes a polygon insert 
> request it looks like:
> 
>   &lt;wfs:Insert&gt;
>    &lt;feature:Geofence
xmlns:feature=&quot;http://mapserver.gis.umn.edu/mapserver&quot;&gt;
>     &lt;feature:the_geom&gt;
>      &lt;gml:MultiPolygon
xmlns:gml=&quot;http://www.opengis.net/gml&quot;&gt;
>       &lt;gml:polygonMember&gt;
>        &lt;gml:Polygon&gt;
>         &lt;gml:outerBoundaryIs&gt;
>          &lt;gml:LinearRing&gt;
>           &lt;gml:coordinates decimal=&quot;.&quot; cs=&quot;,&quot;
ts=&quot; 
> &quot;&gt;-105.662109375,40.1591796875 -107.068359375,38.2255859375 
> -103.640625,37.7861328125
-105.662109375,40.1591796875&lt;/gml:coordinates&gt;
>          &lt;/gml:LinearRing&gt;
>         &lt;/gml:outerBoundaryIs&gt;
>        &lt;/gml:Polygon&gt;
>       &lt;/gml:polygonMember&gt;
>      &lt;/gml:MultiPolygon&gt;
>     &lt;/feature:the_geom&gt;
>    &lt;/feature:Geofence&gt;
>   &lt;/wfs:Insert&gt;
> 
> This appears to be getting done by 
> OpenLayers.Format.WFS.createFeatureXML(feature) and the namespace is 
> hardcoded to &quot;feature:...&quot;
> 
> My question is why this namespace and not the wfs namespace and XML 
> something more like:
> 
>   &lt;wfs:Insert typeName=&quot;Geofence&quot;&gt;
>    &lt;wfs:Property&gt;
>     &lt;wfs:Name&gt;the_geom&lt;/wfs:Name&gt;
>     &lt;wfs:Value&gt;
>      &lt;gml:MultiPolygon
xmlns:gml=&quot;http://www.opengis.net/gml&quot;&gt;
>       &lt;gml:polygonMember&gt;
>        &lt;gml:Polygon&gt;
>         &lt;gml:outerBoundaryIs&gt;
>          &lt;gml:LinearRing&gt;
>           &lt;gml:coordinates decimal=&quot;.&quot; cs=&quot;,&quot;
ts=&quot; 
> &quot;&gt;-105.662109375,40.1591796875 -107.068359375,38.2255859375 
> -103.640625,37.7861328125
-105.662109375,40.1591796875&lt;/gml:coordinates&gt;
>          &lt;/gml:LinearRing&gt;
>         &lt;/gml:outerBoundaryIs&gt;
>        &lt;/gml:Polygon&gt;
>       &lt;/gml:polygonMember&gt;
>      &lt;/gml:MultiPolygon&gt;
>      &lt;/wfs:Value&gt;
>    &lt;/wfs:Property&gt;
>    &lt;wfs:Property&gt;
>     &lt;wfs:Name&gt;name&lt;/wfs:Name&gt;
>     &lt;wfs:Value&gt;noname&lt;/wfs:Value&gt;
>    &lt;/wfs:Property&gt;
>   &lt;/wfs:Insert&gt;
> 
> This would more closely follow the &lt;wfs:Modify&gt; format and
namespace.
> 
> So why should anyone care? mostly the later is much easier to parse as 
> the tags are predetermined by the wfs namespace and not consturcted from 
> the arbitrary attributes used in the layer definition.
> 
> I am interested in the &quot;why of this&quot; so I better understand how
all this 
> works. Reading the code, it looks like this change can be done by 
> overloading createFeatureXML with code that generates the later XML 
> above, so I could make the change myself outside of the OL code base for 
> testing and review.
> 
> If I did that would it be an appropriate change to svn?
> A change to svn, would probably break any existing services that depend 
> on the existing format for &lt;wfs:Insert&gt;.
> 
> Thanks in advance for any thoughts on this.
> 
> -Steve W
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 






More information about the Users mailing list