Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS Server does not respect datum transformation #60216

Open
1 of 2 tasks
jirik opened this issue Jan 22, 2025 · 0 comments · May be fixed by #60239
Open
1 of 2 tasks

QGIS Server does not respect datum transformation #60216

jirik opened this issue Jan 22, 2025 · 0 comments · May be fixed by #60239
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Projections/Transformations Related to coordinate reference systems or coordinate transformation Server Related to QGIS server

Comments

@jirik
Copy link

jirik commented Jan 22, 2025

What is the bug or the crash?

GetMap WMS request to QGIS server shows image with features shifted by few meters comparing to map that is shown in QGIS Desktop when I open the same QGS file.

The QGS file contains two vector layers, layer vaclav-epsg-3857 with four points in EPSG:3857 (green crosses) and layer vaclav-epsg-5514 with the same four points in EPSG:5514 (red circles). The project's CRS is EPSG:3857. One of suggested datum transformations is used:

Image

If I open the QGS file in QGIS Desktop v3.40.2, I see points from both layers placed in the same location:

Image

However, if I publish the same QGS file to QGIS Server v3.40.2 and send WMS GetMap request, e.g.

http://localhost:8090/qgis/?MAP=/qgis/data/vaclav.qgs&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=1606261.367126520025%2C6460065.113021261059%2C1606371.941027208464%2C6460150.805113065057&CRS=EPSG%3A3857&WIDTH=1032&HEIGHT=799&LAYERS=OpenStreetMap,vaclav-epsg-3857,vaclav-epsg-5514&STYLES=&FORMAT=image%2Fpng&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi%3A96&TRANSPARENT=TRUE

four points in vaclav-epsg-5514 layer (red circles) are shifted by several meters:

Image

I expect that points in GetMap request should be in the same location as they are in QGIS Desktop. I guess it's because QGIS Server somehow ignores the selected datum transformation.

I did not find similar bug among open issues. However I found this StackExchange post from 2020 that suggests that the same issue was also with QGIS 3.10: https://gis.stackexchange.com/questions/364744/datum-transformation-in-qgis-server-3-10

Steps to reproduce the issue

  1. Download and unzip file data.zip
  2. Open vaclav.qgs in QGIS Desktop. You should see four green crosses and four red circles from placed in the same locations:

Image
3. Publish the same QGS file to QGIS Server. You can use containerized QGIS Server (this is how I am using it).
4. Send WMS GetMap request, e.g.

http://localhost:8090/qgis/?MAP=/qgis/data/vaclav.qgs&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=1606261.367126520025%2C6460065.113021261059%2C1606371.941027208464%2C6460150.805113065057&CRS=EPSG%3A3857&WIDTH=1032&HEIGHT=799&LAYERS=OpenStreetMap,vaclav-epsg-3857,vaclav-epsg-5514&STYLES=&FORMAT=image%2Fpng&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi%3A96&TRANSPARENT=TRUE

(you probably need to adjust MAP parameter value to correct path).
5. See the error, four points in vaclav-epsg-5514 layer (red circles) are shifted by several meters:

Image

Versions

All QGS file, QGIS Desktop and QGIS Server are v3.40.2. This StackExchange post from 2020 suggests that the issue was also with QGIS 3.10, so maybe it's quite old: https://gis.stackexchange.com/questions/364744/datum-transformation-in-qgis-server-3-10

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@jirik jirik added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 22, 2025
@agiudiceandrea agiudiceandrea added Projections/Transformations Related to coordinate reference systems or coordinate transformation Server Related to QGIS server labels Jan 22, 2025
@elpaso elpaso self-assigned this Jan 23, 2025
elpaso added a commit to elpaso/QGIS that referenced this issue Jan 23, 2025
@elpaso elpaso linked a pull request Jan 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Projections/Transformations Related to coordinate reference systems or coordinate transformation Server Related to QGIS server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants