Bug report #14119

Ensure the OGC filter XML expression contains the GML namespace references.

Added by Jeremy Palmer over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Web Services clients/WFS
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:22121

Description

WFS Servers such as Geoserver won't parse the C XML filter unless it's there. Example expression that fails:

QGIS Expression: "intersects($geometry, geom_from_wkt('POLYGON)'))"

Gets converted to:

OGC XML:
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc xmlns:gml=http://www.opengis.net/ogc">
<ogc:Intersects>
<ogc:PropertyName>geometry</ogc:PropertyName>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates cs="," ts=" ">171.9043399999999906,-43.2101120000000023 172.32836199999999849,-43.2101120000000023 172.32836199999999849,-42.99926099999999707 171.9043399999999906,-42.99926099999999707 171.9043399999999906,-43.2101120000000023</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ogc:Intersects>
</ogc:Filter>

To fix this the expression to OGC XML function should add the xmlns:gml=http://www.opengis.net/ogc namespace. e.g

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc xmlns:gml="http://www.opengis.net/ogc">
<ogc:Intersects>
<ogc:PropertyName>geometry</ogc:PropertyName>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates cs="," ts=" ">171.9043399999999906,-43.2101120000000023 172.32836199999999849,-43.2101120000000023 172.32836199999999849,-42.99926099999999707 171.9043399999999906,-42.99926099999999707 171.9043399999999906,-43.2101120000000023</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ogc:Intersects>
</ogc:Filter>

Associated revisions

Revision 9fe6a9fe
Added by Even Rouault over 8 years ago

QgsOgcUtils: add support to generate WFS 1.1 and 2.0 filters

Fixes #14119: Ensure the OGC filter XML expression contains the GML namespace references

Revision 8fe0c177
Added by Even Rouault about 8 years ago

QgsOgcUtils: add support to generate WFS 1.1 and 2.0 filters

Fixes #14119: Ensure the OGC filter XML expression contains the GML namespace references

History

#1 Updated by Even Rouault over 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF