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

Locate by layer shift with EPSG:3003 #1624

Open
pcav opened this issue May 6, 2020 · 9 comments
Open

Locate by layer shift with EPSG:3003 #1624

pcav opened this issue May 6, 2020 · 9 comments

Comments

@pcav
Copy link
Collaborator

pcav commented May 6, 2020

A shift in the geom shown by locate by layer (the yellow line in comparison with the original geom) is apparent. This happens with several servers.
See for an example:
http://95.216.241.41/index.php/view/map/?repository=castelplanio&project=prg&layers=000BFFFFFTFTTTFTT&bbox=2364771.856423%2C4817408.903284%2C2364919.891094%2C4817515.927457&crs=EPSG%3A3004&layerStyles=PRG%3Apredefinito%3Bconfine%3Adefault
search e.g. for strada VIA BATTISTI CESARE
EPSG:3004, so possibly due to different +towgs parameters

Monte Mario / Italy zone 2
WKT
PROJCRS["Monte Mario / Italy zone 2",
    BASEGEOGCRS["Monte Mario",
        DATUM["Monte Mario",
            ELLIPSOID["International 1924",6378388,297,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4265]],
    CONVERSION["Italy zone 2",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",15,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",2520000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["easting (X)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing (Y)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["unknown"],
        AREA["Italy - east of 12°E"],
        BBOX[34.76,12,47.1,18.99]],
    ID["EPSG",3004]]
Proj4
+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +units=m +no_defs
Estensione
12.00, 34.76, 18.99, 47.10

See a thread here:
https://lists.osgeo.org/pipermail/lizmap/2020-February/000059.html
QGIS 3.10, Lizmap 3.3.0

@pcav pcav added the bug label May 6, 2020
@pcav
Copy link
Collaborator Author

pcav commented Feb 24, 2021

Still true for current release (3.4.1).
I added a proj4php definition:

/var/www/lizmap-web-client-3.4.1/lizmap/vendor/proj4php/proj4php/src/proj4php/defs/EPSG3004.php

<?php
Proj4php::$defs["EPSG:3004"] = "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +units=m +no_defs");

to no avail.

@pcav
Copy link
Collaborator Author

pcav commented Feb 24, 2021

My interpretation is that the +towgs84 param is not interpreted.

@pcav
Copy link
Collaborator Author

pcav commented Feb 24, 2021

In fact, in test/codes.json the definition does not have +towgs:

    "EPSG:3004": {
        "ogcwkt": "PROJCS[\"Monte Mario \/ Italy zone 2\",GEOGCS[\"Monte Mario\",DATUM[\"Monte_Mario\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6265\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4265\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",15],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",2520000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3004\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]",

@nboisteault
Copy link
Member

@pcav Could this be related? qgis/QGIS#39040

@rmarzocchi84
Copy link
Contributor

I confirm the same problem

It seem related to specific EPSG (e.g 3003 or 3004 for Italy), so I confirm it is related to towgs84 parameter. I am not sure it can be related to WMTS becuase the GetFeatureInfo is a WMS method

@pcav
Copy link
Collaborator Author

pcav commented Mar 3, 2021

I believe it is related to pro4js (or proj4php). I opened a ticket there, with little sucess for now.

@Gustry
Copy link
Member

Gustry commented Sep 16, 2024

The locate by layer has been rewritten for LWC 3.8, allowing expressions and HTML layouts.

@pcav @mind84 @ghmttt or @rmarzocchi84 Can you try package 3.8.1-pre if you still replicate the issue ?

Is-it only on EPSG:3003 EPSG:3004 in Italy ?

Copy link

This issue is missing some feedbacks. 👻
Please have a look to the discussion, thanks. 🦎

@github-actions github-actions bot added the stale This ticket might be closed soon label Nov 11, 2024
@mind84
Copy link
Contributor

mind84 commented Nov 12, 2024

Hi @Gustry!

yep, the shift problem still standing. I think that it has nothing to do with the specific tool, as it also affects, for example atlas or edition layer. It's a projection problem coming from QGIS: for EPSG:3003 and EPSG:3004 the proj4 definition doesn't include the +towgs84 parameter (and I think that's the correct behavior since it's not, I guess, the correct way to perform coordinate conversion (?)). If I'm not mistaken, Lizmap reads the proj4 config from .qgs file

You can see the shift also on this project (Lizmap 3.8.2): just click on a feature and zoom in on the features boundaries.

image

Client side, as far as I understand, the feature geometry (yellow line) is retrieved in EPSG:4326 (geojson specs) and converted by proj4 library into the project projection EPSG:3003 whereas the underlying WMS image is served directly from QGIS Server.

POSSIBLE SOLUTION, NOT TESTED
Define a custom EPSG:3003 projection in GIS project including the +towgs84 parameter.

@3liz-bot 3liz-bot removed the stale This ticket might be closed soon label Nov 12, 2024
@Gustry Gustry changed the title Locate by layer shift Locate by layer shift with EPSG:3003 Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants