-
Notifications
You must be signed in to change notification settings - Fork 802
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
Automatic datum shift when +nadgrids=@nul is not explicitly given #22
Comments
Comment by warmerdam on 27 Nov 2008 14:36 UTC Could you provide the exact command used for at least a couple of these? Did you use cs2cs? Also, was this 4.6.1? |
Comment by janh on 27 Nov 2008 15:23 UTC |
Attachment added by janh on 27 Nov 2008 15:23 UTC |
Tried to reproduce this with the script below.
Which results in the following output:
I conclude that what is discussed in this issue is mostly fixed. The unexpected results in 3) is probably caused by the ellipsoid parameters being adjusted in
|
OSGeo#22. Make sure to not change ellipsoid parameters to WGS84 when applying the null grid. Coordinates will still refer to the input ellipsoid so we keep the original parameters which in turn will be used when the coordinates are transformated to/from cartesian/geocentric space. Adjusted regression test material in nad/proj_outIGNF.dist slightly to accomodate numerical differences at the mm level. The transformations in question are at best accurate to about 1m so this shouldn't change real world usage of these transformations.
The fix in OSGeo#22 solved the problem at hand and doing what was expected from the specified parameters. Unfortunately it also removed the slightly hacky "feature" that makes the web mercator work in pj_transform. The web mercator is special since the latitude is computed on the ellipsoid, but behaves as if if was defined on a sphere. Hence it is problematic to change the ellipsoid parameters when using the web mercator, even though that is the geodetically correct thing to do. The web mercator is used in more or less any web mapping application and is thus one of the most frequently used transformations in PROJ. This justifies re-introducing the minor bug reported in OSGeo#22. The problem will have to be taken care of properly when pj_transform is removed from the library in favour of the transformation pipelines based API.
The fix in #22 solved the problem at hand and doing what was expected from the specified parameters. Unfortunately it also removed the slightly hacky "feature" that makes the web mercator work in pj_transform. The web mercator is special since the latitude is computed on the ellipsoid, but behaves as if if was defined on a sphere. Hence it is problematic to change the ellipsoid parameters when using the web mercator, even though that is the geodetically correct thing to do. The web mercator is used in more or less any web mapping application and is thus one of the most frequently used transformations in PROJ. This justifies re-introducing the minor bug reported in #22. The problem will have to be taken care of properly when pj_transform is removed from the library in favour of the transformation pipelines based API.
Reported by janh on 27 Nov 2008 14:27 UTC
An automatic datum shift to WGS84 seems to take place, even when not requested.
Test point 9018/375648 (Dutch RD, EPSG:28992 without WGS84 datum shift)
The source PROJ string is:
+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs.
I tested this string both without and with +nadgrids=@null on four target projections:
to latlon Bessel (+proj=longlat +ellps=bessel +no_defs)
--> (without nadgrids in source) 3.291612 51.352060
--> (with nadgrids null in source) 3.291612 51.351476
to latlon Bessel with nadgrids null (+proj=longlat +ellps=bessel +no_defs +nadgrids=@null)
--> (without nadgrids in source) 3.291612 51.352643
--> (with nadgrids null in source) 3.291612 51.352060
to latlon Bessel on the WGS84 datum (+proj=longlat +ellps=bessel +no_defs +datum=WGS84)
--> (without nadgrids in source) 3.291612 51.352060
--> (with nadgrids null in source) 3.291612 51.351476
to latlon on the WGS84 datum (+proj=longlat +no_defs +datum=WGS84)
--> (without nadgrids in source) 3.291612 51.352643
--> (with nadgrids null in source) 3.291612 51.352060
and 3) give the same results; so do 2) and 4), which seems to inicate that an automatic datum shift to WGS84 takes place, even when not requested. I'm not sure about the effects of +nadgrids=@null. Specifying +ellips=bessel without adding +nadgrids=@null seems to cause an automatic WGS84 datum shift, whether or no datum=WGS84 is specified (1a = 3a). If +nadgrids=@null is specified in the the source projection, but not in the target projection (1b = 3b), the latlon coordinates shift about 65m to the south. When +nadgrids=@null is omitted in the source projection, but added in the target projection, the resulting coordinates are shifted of 65M to the north (2a). Finally, when +nadgrids=@null is specified in both source and target projections, the datum shift is applied nevertheless (2b is equal to 1a and 3a). Finally, specifying a WGS84 datum shift for the target projection without the Bessel ellipsoide gives the same values as 2.
Migrated-From: https://trac.osgeo.org/proj/ticket/22
The text was updated successfully, but these errors were encountered: