qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.34k stars 2.98k forks source link

WFS GetFeature request is not using project CRS despite it is offered by WFS #44325

Open pathmapper opened 3 years ago

pathmapper commented 3 years ago

Describe the bug WFS GetFeature request is not using project CRS despite it is offered by WFS. This leads to an on-the-fly reprojection which wouldn't be needed if the GetFeature request would use the project CRS.

image

How to Reproduce

  1. From the QGIS top menu: Settings -> Options -> CRS -> use EPSG:4326 as default CRS

image

  1. Restart QGIS
  2. Add WFS connection: https://geoservices.krzn.de/security-proxy/services/wfs_verb_grenzen
  3. Use Debuggin/Development Tools to observe the requests
  4. Add layer: gis:kreisgrenzen
  5. See error: The WFS GetFeature request uses CRS EPSG:25832 despite the project CRS is EPSG:4326 and the WFS offers EPSG:4326.

https://geoservices.krzn.de/security-proxy/services/wfs_verb_grenzen?SERVICE=WFS&REQUEST=GetCapabilities&ACCEPTVERSIONS=2.0.0,1.1.0,1.0.0

image

QGIS and OS versions

QGIS version 3.21.0-Master QGIS code revision da03027583
Qt version 5.12.8
Python version 3.8.10
GDAL/OGR version 3.0.4
PROJ version 6.3.1
EPSG Registry database version v9.8.6 (2020-01-22)
Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1
SQLite version 3.31.1
PostgreSQL client version 12.7 (Ubuntu 12.7-0ubuntu0.20.04.1)
SpatiaLite version 4.3.0a
QWT version 6.1.4
QScintilla2 version 2.11.2
OS version Ubuntu 20.04.2 LTS
       
Active Python plugins sagaprovidergrassproviderMetaSearchprocessingdb_manager

Additional context

Noticed this while investigating https://github.com/qgis/QGIS/issues/44054, which might have to do with the on-the-fly reprojection.

gioman commented 3 years ago
5\. See error: The WFS GetFeature request uses CRS `EPSG:25832` despite the project CRS is `EPSG:4326` and the WFS offers `EPSG:4326`.

@pathmapper it seems that the logic (of QGIS Browser) is to use the default CRS. If the user needs/wants to add the layer with another CRS it should the "add WFS layer" dialog, that offers the option.

pathmapper commented 3 years ago

@gioman right, the default CRS is used when adding a WFS via QGIS Browser.

In contrary, if a WMS is added via QGIS Browser, the project CRS is used if available. If the projects CRS is not offered by the WMS, the first CRS in the CRS list of the GetCapabilities is used instead.

I think this logic makes also sense when adding WFS via QGIS Browser to avoid reprojection and have the same behaviour as WMS:

If you don't think it's a bug and it makes sense, would you please label it as a Feature Request?

pathmapper commented 3 years ago

If the user needs/wants to add the layer with another CRS it should the "add WFS layer" dialog, that offers the option.

There's also the project CRS the default selection for this dialog, not the default CRS from WFS.

pathmapper commented 3 years ago

@gioman why was the stale label added despite the Feedback label was removed? There's also not the usual stale message posted.

gioman commented 3 years ago

why was the stale label added

@pathmapper it is an automatic process, not manual.

pathmapper commented 3 years ago

@gioman sure, but I was wondering what has triggered the process...