question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vertical datum transformation based on PROJ

See original GitHub issue

Hi all, I’ve been trying to apply vertical transformation of data using pyproj. For example, converting heights from the WGS84 ellipsoid to the EGM96 geoid. Using the EGM .gtx files of PROJ here, I get a good result using the old pyproj.Proj method with init and geoidgrids keyword argument (example inspired by https://gis.stackexchange.com/questions/340392/vertical-datum-transformation-using-pyproj):

import pyproj
lat = 43.70012234
lng = -79.41629234
z = 100
#WGS84 datum ellipsoid height
ellipsoid=pyproj.Proj(init="EPSG:4326")
#EGM96 geoid in Chile, we expect about 30 m difference
geoid=pyproj.Proj(init="EPSG:4326", geoidgrids='/home/atom/downloads/egm96_15.gtx')
print(pyproj.transform(ellipsoid, geoid, lng, lat, z))

for which I get:

:8: DeprecationWarning: This function is deprecated. See: https://pyproj4.github.io/pyproj/stable/gotchas.html#upgrading-to-pyproj-2-from-pyproj-1 (-79.41629234, 43.70012234, 137.28983978090645)

I looked for another way to do this with current Pyproj methods but couldn’t find anything or any issue referenced on this. I’m thus wondering:

  1. Is there a non-deprecated method for performing the same vertical grid referencing + transformation?
  2. Would it be a possibility to add an integrated download/checksum method in pyproj for automated vertical datum extraction, as exists in PROJ? Right now a lot of people do this manually in their own Python repos (e.g., https://github.com/adehecq/geoutils/tree/master/geoutils/EGM96) so there is quite a need in the community for this. I might not be aware of all existing solutions, but I think this belongs in Pyproj 😃

Thanks a lot in advance!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rhugonnetcommented, Feb 16, 2021

Yes, thanks a lot! 😃 And sorry for not getting back to you sooner, busy months.

0reactions
snowman907commented, Mar 17, 2021

Thanks, @rhugonnet for your insight and @snowman2 for your hard work developing pyproj and responding patiently to a large number of issues with the same question.

Yay for snowmans lol

Read more comments on GitHub >

github_iconTop Results From Across the Web

Geodetic transformation — PROJ 9.1.1 documentation
The Molodensky transformation converts directly from geodetic coordinates in one datum, to geodetic coordinates in another datum, while the (typically more ...
Read more >
Vertical Datum transformation using Pyproj
The accepted answer has a couple of flaws I'd like to address. First, the objection to the use of NAD83 is misplaced.
Read more >
FAQ: How do I apply a vertical datum transformation in ArcGIS ...
A horizontal geographic transformation and vertical datum transformation cannot be applied in the same Project tool process. These operations ...
Read more >
NOAA/NOS's VDatum 4.5.1: Vertical Datums Transformation
VDatum is designed to vertically transform geospatial data among a variety of tidal, orthometric and ellipsoidal vertical datums - allowing users to convert ......
Read more >
Specify a datum transformation—ArcGIS Pro | Documentation
The Transformation tab on the Map Properties dialog box lists the geographic and vertical coordinate systems of the layers and the current geographic...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found