Description
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:
- Is there a non-deprecated method for performing the same vertical grid referencing + transformation?
- 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!