Open WouterVermeyenSBE opened 1 year ago
@rldhont @mdouchin what is the proper way to define a custom projection for Lizmap?
@WouterVermeyenSBE Lizmap is getting projection definition from within the QGIS project file.
@rldhont But we still ended up without the +towgs84=-99.1,53.3,-112.5,0.419,-0.83,1.885,-1.0 parameter on in the proj4js of lizmap. Can there be a bug there?
So you mean even if both your QGS and QGS.CFG files have the correct definition you would like to use, in the web interface, one part is missing ?
Yes, I posted the screenshot of the Proj4js defs after we uploaded the correct string everywhere.
What is the bug?
We tried adding the EPSG:31370 to Lizmap, but we keep ending up with not the specific version we need.
Specifically the version with the extra correction : +proj=lcc +lat_1=51.16666723333334 +lat_2=49.83333389999999 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +units=m +no_defs
Not the standard QGIS version: +proj=lcc +lat_1=51.16666723333334 +lat_2=49.83333389999999 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-99.1,53.3,-112.5,0.419,-0.83,1.885,-1.0 +units=m +no_defs
In order to facilitate this we looked at 4 things the proj4 def on 4 spots
We added a EPSG31370.php file to
/var/www/lizmap-web-client-3.6.7/lizmap/vendor/proj4php/proj4php/src/proj4php/defs
We added a EPSG31370.js file to
/var/www/lizmap-web-client-3.6.7/lizmap/www/assets/js/Proj4js/defs
Proj4js.defs["EPSG:31370"] = "+proj=lcc +lat_1=51.16666723333334 +lat_2=49.83333389999999 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-99.1,53.3,-112.5,0.419,-0.83,1.885,-1.0 +units=m +no_defs"
We checked the value in the qgs project proj4 tag
We checked the value in the cfg file
"projection": {"proj4": "+proj=lcc +lat_1=51.16666723333334 +lat_2=49.83333389999999 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-99.1,53.3,-112.5,0.419,-0.83,1.885,-1.0 +units=m +no_defs", "ref": "EPSG:31370"}
We still end up with the following when we load the webpages and we end with the CRS with out the
+towgs84=-99.1,53.3,-112.5,0.419,-0.83,1.885,-1.0
part.We have a workaround but we can't figure out where the wrong crs proj4 is coming from.
Workaround JS script:
Steps to reproduce the issue
1) Add the custom epsg files. 2) Load the Lizmap project 3) Open de dev tools and in console type: Proj4js.defs
Versions
Versions :
Check Lizmap plugin
QGIS server version, only if the section above doesn't mention the QGIS Server version
No response
Operating system
Ubuntu 20.04.2
Browsers
Firefox, Chrome, Microsoft Edge
Browsers version
Firefox Version 119.0
Relevant log output
No response