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
PROJ 6 issues with +init=epsg:2056 (CH1903+/LV95) #1597
Comments
… lon_0 (related to OSGeo#1597)
…psg:xxxx +no_defs' string (related to OSGeo#1597)
…ixes OSGeo#1597) Currently, +init=epsg:XXXX expansion from proj.db didn't make any effort to try to add a +towgs84 clause. Now this will do using CRS::createBoundCRSToWGS84IfPossible() Note that however this does not perfectly emulated PROJ4/PROJ5 epsg file behaviour, and will only add a +towgs84 when it is valid for the whole area of use of the CRS, whereas PROJ4/PROJ5 would add the one that was valid for the largest sub-area of use. The additiong of a +towgs84 clause will be thus more likely for a projected CRS valid for a country, rather than for a geographic CRS valid for a continent or a larger area, and thus whose transformations to WGS84 might be multiple. The consequence of this shows up in some GIGS test that must be adapted to add an explicit +towgs84 for source/target geographic CRS with value equal to the one of the source/target projected CRS.
@dg0yt Potential fixes in #1600 . Note however as indicated in the PR that the commit really fixing your issue could be controversial. Basically one cannot expect PROJ6 to be perfectly backward compatible with previous PROJ versions. Hence the deprecation for the +init=epsg:XXXX syntax. Using proj_create_crs_to_crs(ctx, "EPSG:4326", "EPSG:2056", NULL) is the strongly recommended way of proceeding. Or fully expand the +init=epsg:XXXX to their "+proj= ...." content including +towgs84 clauses.
|
Thanks for the hint. IIUC this also needs to be added to the migration documentation, because this is where the code comes from, except for not using |
we'd welcome if you could submit a PR for that |
I do understand that, and maybe it is best to leave it as it is. However, I see software being recompiled with the macro enabling the deprecated API, e.g. for the Debian proj transition, and this error has the potential to go unnoticed for a while. (Even the Potsdam bug in the new API seems to have gone unnoticed for a while.) |
… lon_0 (related to OSGeo#1597)
…psg:xxxx +no_defs' string (related to OSGeo#1597)
… support of +init=epsg:XXXX syntax (relates to OSGeo#1597)
…psg:xxxx +no_defs' string (related to #1597)
… support of +init=epsg:XXXX syntax (relates to #1597)
We've finally decided not to try to fix the pj_transform() use case, but rather document it: 73042b0 |
[Backport 6.2] Fixes related to #1597
Using the old API with PROJ 6 instead of 4.9.3, we noticed wrong transformation results between EPSG:4326 and EPSG:2056 (CH1903+/LV95) (OpenOrienteering/mapper#1325). Even after switching to the new API (with legacy proj4 init rules enabled), results are correct only if the
no_defs
parameter is not used. Despite all the legacy stuff: This is a clear regression which should not happen at least when using the old API.I was now able to create a test executable which uses the EPSG:2056 center of projection for demonstration. Note that only the last line is matching the expected results.
proj-test.zip (updated)
The text was updated successfully, but these errors were encountered: