Bug report #18345

WFS 1.1.0 broken by inverted axis in QGIS Server

Added by Alessandro Pasotti over 2 years ago. Updated almost 2 years ago.

Status:Closed
Priority:High
Assignee:René-Luc ReLuc
Category:QGIS Server
Affected QGIS version:3.0.0 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:no timely feedback
Crashes QGIS or corrupts data:No Copied to github as #:26235

Description

Apparently QGIS Server supports WFS 1.1.0 as advertised by its getcapabilities, but when requested to getcapabilities for VERSION=1.1.0 it does no return anything different from the default (which is 1.0).

The result is that QGIS WFS client gets confused and you get inverted axis.

Specifying WFS version 1.1 in the client, does not help while setting it to 1.0 does.

Note that the default setting for WFS is AUTO which also fails.

History

#1 Updated by Alessandro Pasotti over 2 years ago

To be more precise: the returned XML is different, what does not change is the SRS specification: according to the specs, it should be urn:x-ogc:def:crs:EPSG:xxxx instead of EPSG: , a WFS 1.1 server returning EPSG:xxxx is not really expected, and a source of confusion

This confuses the client and it is probably a violation of the specifications (not 100% sure about that).

See also: http://docs.geoserver.org/latest/en/user/services/wfs/basics.html#axis-ordering

#2 Updated by Alessandro Pasotti over 2 years ago

Another evidence: getFeature call always return 1.1 format but coordinates are not inverted and epsg code is not URN prefixed.

I believe this is the real problem: when using WFS 1.1 the coordinates should be lat/lon and the srsName should be prefixed with urn:ogc:def:crs:

GeoServer fully respect this and Mapserver does it partially: see http://mapserver.org/ogc/wfs_server.html#axis-orientation-in-wfs-1-1-and-2-0

#3 Updated by Alessandro Pasotti over 2 years ago

  • Subject changed from WFS 1.1.0 broken in QGIS Server to WFS 1.1.0 broken by inverted axis in QGIS Server

Things looks more complicated than it seems,

This email exchange is enlightning:
http://lists.osgeo.org/pipermail/standards/2016-October/000994.html

See also:
https://tools.ietf.org/html/rfc5165

And:
http://www.ogcnetwork.net/axisorder

the bottomline is that we should probably change WFS 1.1.0 getfeature response to:
- use urn: prefixed srsName
- return lat/lon instead of lon/lat in GML

#4 Updated by Giovanni Manghi over 2 years ago

  • Priority changed from Normal to High
  • Affected QGIS version changed from master to 3.1(master)
  • Regression? changed from No to Yes

Is this a regression or is also true for 2.*?

#5 Updated by Giovanni Manghi over 2 years ago

  • Status changed from Open to Feedback

#6 Updated by Alessandro Pasotti over 2 years ago

I don't think this applies to 2.x: the server code has changed completely and AFAIK WFS 1.1 was not supported in 2.x

#8 Updated by René-Luc ReLuc over 2 years ago

  • Assignee set to René-Luc ReLuc

Is the master 3.1 or the release 3.0 affected by this issue ?

#9 Updated by Alessandro Pasotti over 2 years ago

Both.

But you'd better wait for https://github.com/qgis/QGIS/pull/6644 if you want to fix it.

#10 Updated by René-Luc ReLuc over 2 years ago

  • Affected QGIS version changed from 3.1(master) to 3.0.0

#11 Updated by Alessandro Pasotti over 2 years ago

Merged: let me know if you need help.

#12 Updated by Alessandro Pasotti over 2 years ago

Can we close this one?

#13 Updated by Nyall Dawson almost 2 years ago

  • Status changed from Feedback to Closed
  • Resolution set to no timely feedback

Also available in: Atom PDF