epsg.io icon indicating copy to clipboard operation
epsg.io copied to clipboard

proj4 +towgs84 property in EPSG:2039 gives offset in transformation

Open shmueldarchi opened this issue 2 years ago • 5 comments

I used your proj4 value for transforming coordinates from WGS84 to EPSG:2039 with OL Transform and Proj4js. The transformation had an offset of about 100 meters. After researching, I found that the value had a transformation from: +proj=tmerc +lat_0=31.7343936111111 +lon_0=35.2045169444444 +k=1.0000067 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +towgs84=23.772,17.49,17.859,0.3132,1.85274,-1.67299,-5.4262 +units=m +no_defs +type=crs to: +proj=tmerc +lat_0=31.7343936111111 +lon_0=35.2045169444444 +k=1.0000067 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +towgs84=-24.0024,-17.1032,-17.8444,-0.33009,-1.85269,1.66969,5.4248 +units=m +no_defs +type=crs. After the change, the transform worked correctly.

NOTE I didn't see any open source that gives this value by default, so if it's not correct, I would like to know.

BR,

shmueldarchi avatar Jan 24 '23 11:01 shmueldarchi

The same issue has just been reported to PROJ at https://github.com/OSGeo/PROJ/issues/4170 regarding EPSG:31370 "Belgian lambert 72". It would be nice to have this corrected, as exporting wrong transformation parameters is causing downstream issues.

rouault avatar Jun 14 '24 23:06 rouault

@shmueldarchi inverting the sign of the 4th, 5th and 6th parameters of towgs84 also do it:

+proj=tmerc +lat_0=31.7343936111111 +lon_0=35.2045169444444 +k=1.0000067 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +towgs84=23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262 +units=m +no_defs +type=crs

rouault avatar Jun 14 '24 23:06 rouault

Cf https://github.com/OSGeo/PROJ/issues/4170#issuecomment-2168492328 for the analysis of the root cause: the parameters of Helmert transformation using the Coordinate Frame rotation convention are used unmodified in a TOWGS84 clause. But a TOWGS84 clause requires them to use the Position Vector convention, which differs from the Coordinate Frame one by the sign of the rotation terms (4th, 5th and 6th terms)

rouault avatar Jun 24 '24 12:06 rouault

Thanks for spotting the bug! Thank you, @rouault, for your comments here...

This should be fixed together with https://github.com/OSGeo/PROJ/issues/4170 in the upcoming update of the webpage by @TomPohys

Perhaps we could schedule a call to discuss the defined problems during FOSS4GE? I was just talking to @hobu on LinkedIn... we are keen to help and reduce pains, and make this project better

klokan avatar Jun 24 '24 13:06 klokan

This issue (and #190 as well) seems to have been fixed, but looking at https://github.com/maptiler/epsg.io/commits/master/ , I don't see any relevant commit but a README update (does https://github.com/maptiler/epsg.io reflect what runs on the epsg.io website... ?) . @jachym ?

rouault avatar Oct 17 '24 18:10 rouault