I want to convert wgs84 coordinates with ellipsoidal height to wgs84 coordinates with height above goid. Therefore I have set up a new conda environment and installed pyproj, proj_data, see conda list below. I found the EPSG codes 'EPSG:4979' for ellipsoidal height and 'EPSG:9705' for mean sea level.
Then I run:
import pyproj
define coordinates
lat = 54.44
lon = 9.88
z = 100
define CRSs
wgs84_ellipse = pyproj.crs.CRS.from_epsg(4979)
wgs84_msl = pyproj.crs.CRS.from_epsg(9705)
create transformer
tform = pyproj.transformer.Transformer.from_crs(crs_from=wgs84_ellipse, crs_to=wgs84_msl, always_xy=True)
transform coordinates
print(tform.transform(lon,lat,z))
Which gives me the same z-component back as I put in:
(9.88, 54.44, 100)
However, here I see that the goid height should be approx. 40m at this location:
https://geographiclib.sourceforge.io/cgi-bin/GeoidEval?input=54.44+9.88&option=Submit
Therefore, I would expect my code to return a value of about 100m-40m = 60m for the z-component.
Why is pyproj not giving me the height I expect?
Edit:
When I further run:
from pyproj.transformer import TransformerGroup
t = TransformerGroup(wgs84_ellipse, wgs84_msl, always_xy=True)
I get the following warning:
UserWarning: Best transformation is not available due to missing Grid(short_name=Und_min1x1_egm2008_isw=82_WGS84_TideFree.gz, full_name=, package_name=, url=, direct_download=False, open_license=False, available=False)
Then I went to
https://earth-info.nga.mil/index.php?dir=wgs84&action=wgs84
and downloaded under Data/Apps -> EGM2008, this file:
https://earth-info.nga.mil/php/download.php?file=egm-08spherical
The readme mentions the file I am looking for called "Und_min1x1_egm2008_isw=82_WGS84_TideFree.gz". However, after extracting the archive, I can not find the file.
Now the questions is: How do I get the missing grid file?
To create the conda environment I ran:
conda create -n "test_env" python=3.11.0
conda install -c conda-forge pyproj
conda install -c conda-forge proj-data
conda list returns:
# Name Version Build Channel
bzip2 1.0.8 h8ffe710_4 conda-forge
ca-certificates 2022.12.7 h5b45459_0 conda-forge
certifi 2022.12.7 pyhd8ed1ab_0 conda-forge
jpeg 9e hcfcfb64_3 conda-forge
krb5 1.20.1 heb0366b_0 conda-forge
lerc 4.0.0 h63175ca_0 conda-forge
libcurl 7.88.1 h68f0423_0 conda-forge
libdeflate 1.17 hcfcfb64_0 conda-forge
libffi 3.4.2 h8ffe710_5 conda-forge
libsqlite 3.40.0 hcfcfb64_0 conda-forge
libssh2 1.10.0 h9a1e1f7_3 conda-forge
libtiff 4.5.0 hf8721a0_2 conda-forge
libzlib 1.2.13 hcfcfb64_4 conda-forge
openssl 3.0.8 hcfcfb64_0 conda-forge
pip 23.0.1 pyhd8ed1ab_0 conda-forge
proj 9.1.1 heca977f_2 conda-forge
proj-data 1.13 hd8ed1ab_0 conda-forge
pyproj 3.4.1 py311h36482e4_1 conda-forge
python 3.11.0 hcf16a7b_0_cpython conda-forge
python_abi 3.11 3_cp311 conda-forge
setuptools 67.4.0 pyhd8ed1ab_0 conda-forge
sqlite 3.40.0 hcfcfb64_0 conda-forge
tk 8.6.12 h8ffe710_0 conda-forge
tzdata 2022g h191b570_0 conda-forge
ucrt 10.0.22621.0 h57928b3_0 conda-forge
vc 14.3 hb6edc58_10 conda-forge
vs2015_runtime 14.34.31931 h4c5c07a_10 conda-forge
wheel 0.38.4 pyhd8ed1ab_0 conda-forge
xz 5.2.6 h8d14728_0 conda-forge
zstd 1.5.2 h12be248_6 conda-forge