Locate by layer shift
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
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.
My interpretation is that the +towgs84 param is not interpreted.
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]]",
@pcav Could this be related? https://github.com/qgis/QGIS/issues/39040
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
I believe it is related to pro4js (or proj4php). I opened a ticket there, with little sucess for now.
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 ?
This issue is missing some feedbacks. 👻 Please have a look to the discussion, thanks. 🦎
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.
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.
This issue is missing some feedbacks. 👻 Please have a look to the discussion, thanks. 🦎