Skip to content
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

Difference in lonlat to utm with current master #1808

Closed
snowman2 opened this issue Dec 24, 2019 · 3 comments
Closed

Difference in lonlat to utm with current master #1808

snowman2 opened this issue Dec 24, 2019 · 3 comments

Comments

@snowman2
Copy link
Contributor

cs2cs
Rel. 6.2.1, November 1st, 2019
usage: cs2cs [-dDeEfIlrstvwW [args]] [+opt[=arg] ...]
                   [+to +opt[=arg] ...] [file ...]
echo '-111.5 45.25919444444' | cs2cs '+proj=longlat +datum=WGS84' '+proj=utm +zone=10 +datum=NAD27'
1402291.08	5076289.59 0.00

Current master:

./cs2cs
Rel. 6.3.0, January 1st, 2020
usage: cs2cs [-dDeEfIlrstvwW [args]] [+opt[=arg] ...]
                   [+to +opt[=arg] ...] [file ...]
echo '-111.5 45.25919444444' | ./cs2cs '+proj=longlat +datum=WGS84' '+proj=utm +zone=10 +datum=NAD27'
1402285.98	5076292.42 0.00

Just noticed the difference and wanted to make sure it was expected. Feel free to close this issue if everything is okay.

@rouault
Copy link
Member

rouault commented Dec 24, 2019

If there's only the US 'conus' grid available, the master result is appropriate as it uses it. PROJ 6.2.1 used the NAD27 to WGS 84 (3) operation using a rough Helmert transformation, valid for Canada, which wasn't the best choice.
That said, with this test point, and both the US 'conus' and Canadian 'ntv2_0.gsb' grids were available, the later was tried, and as the point didn't find in any of its subgrid it resulted in an error. So #1809 adds a logic to fallback to the next best choice, so here 'conus'

rouault added a commit to rouault/PROJ that referenced this issue Dec 24, 2019
@rouault rouault closed this as completed Dec 24, 2019
@snowman2
Copy link
Contributor Author

Thanks!

@snowman2
Copy link
Contributor Author

Just relaying tests results with 6.3.0RC1:

$ ls ../share/proj/
alaska        GL27      nad27         nzgd2kgrid0005.gsb    stlrnc
BETA2007.gsb  hawaii    nad83         other.extra           stpaul
CH            ITRF2000  nad.lst       proj.db               TN
conus         ITRF2008  ntf_r93.gsb   projjson.schema.json  WI
egm96_15.gtx  ITRF2014  ntv1_can.dat  prvi                  WO
FL            MD        null          stgeorge              world

echo '-111.5 45.25919444444' | ./cs2cs '+proj=longlat +datum=WGS84' '+proj=utm +zone=10 +datum=NAD27'
1402285.98	5076292.42 0.00
./projinfo -s '+proj=longlat +datum=WGS84 +type=crs' -t '+proj=utm +zone=10 +datum=NAD27 +type=crs'

Operation n°1:

unknown id, axis order change (2D) + Inverse of NAD27 to WGS 84 (3) + axis order change (2D) + UTM zone 10N, 20 m, Canada - NAD27

PROJ string:
+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=push +v_3 +step +proj=cart +ellps=WGS84 +step +proj=helmert +x=10 +y=-158 +z=-187 +step +inv +proj=cart +ellps=clrk66 +step +proj=pop +v_3 +step +proj=utm +zone=10 +ellps=clrk66
--
Operation n°2:

unknown id, axis order change (2D) + Inverse of NAD27 to WGS 84 (79) + axis order change (2D) + UTM zone 10N, 5 m, USA - CONUS including EEZ

PROJ string:
+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=hgridshift +grids=conus +step +proj=utm +zone=10 +ellps=clrk66
--

Then, downloading proj-datumgrid-north-america-1.3RC1.tar.gz:

echo '-111.5 45.25919444444' | ./cs2cs '+proj=longlat +datum=WGS84' '+proj=utm +zone=10 +datum=NAD27'
1402286.33	5076292.30 0.00
./projinfo -s '+proj=longlat +datum=WGS84 +type=crs' -t '+proj=utm +zone=10 +datum=NAD27 +type=crs'

Operation n°1:

unknown id, axis order change (2D) + Inverse of NAD27 to WGS 84 (33) + axis order change (2D) + UTM zone 10N, 1 m, Canada - NAD27

PROJ string:
+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=hgridshift +grids=ntv2_0.gsb +step +proj=utm +zone=10 +ellps=clrk66
--
Operation n°2:

unknown id, axis order change (2D) + Inverse of NAD27 to WGS 84 (3) + axis order change (2D) + UTM zone 10N, 20 m, Canada - NAD27

PROJ string:
+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=push +v_3 +step +proj=cart +ellps=WGS84 +step +proj=helmert +x=10 +y=-158 +z=-187 +step +inv +proj=cart +ellps=clrk66 +step +proj=pop +v_3 +step +proj=utm +zone=10 +ellps=clrk66
--
Operation n°3:

unknown id, axis order change (2D) + Inverse of NAD27 to WGS 84 (79) + axis order change (2D) + UTM zone 10N, 5 m, USA - CONUS including EEZ

PROJ string:
+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=hgridshift +grids=conus +step +proj=utm +zone=10 +ellps=clrk66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants