1

I am trying to develop Python code to do a vertical datum transformation between WGS84 (GNSS elipsoid height) to NAVD88 geoid height. I have seen and copied the code from @asynchron located in the post here.

My code (below) returns the same elevation as the input elevation but this UNAVCO site states that my expected values should be 93.22m converted from the 72.5m input elevation at my latitude and longitude.

import pyproj

def convert_wgs84_to_navd88(latitude, longitude, altitude_wgs84): wgs84 = pyproj.crs.CRS.from_epsg(4979) # WGS84 CRS navd88 = pyproj.crs.CRS.from_epsg(5498) # NAVD88 CRS

transformer = pyproj.transformer.Transformer.from_crs(crs_from=wgs84, crs_to=navd88)

converted_latitude, converted_longitude, converted_altitude_navd88 = transformer.transform(latitude, longitude, altitude_wgs84)

return converted_latitude, converted_longitude, converted_altitude_navd88

latitude = 48.790886 # Example latitude in decimal degrees longitude = 122.625369 # Example longitude in decimal degrees altitude_wgs84 = 72.5 # Example altitude in meters (WGS84)

converted_latitude, converted_longitude, converted_altitude_navd88 = convert_wgs84_to_navd88(latitude, longitude, altitude_wgs84)

print(f"Converted Latitude (NAVD88): {converted_latitude}") print(f"Converted Longitude (NAVD88): {converted_longitude}") print(f"Converted Altitude (NAVD88): {converted_altitude_navd88}")

asychron suggests that this is because I do not have any vertical transformation grids installed (which is true to my knowledge because I have not installed any gtx grid transformation files.

Furthermore, asychon states that a missing grid transformation file will return a noop value but I do not see a noop value in any error message nor do I see this when watching the variable in my Python IDE. Here is the variable information from the IDE. Sorry for the image paste but WingIDE is not letting me copy text from the variable watch portion of the IDE: enter image description here

How do I convert elevation in WGS84 ellipsoid heights to NAVD88 elevations with Pyproj.

Vince
  • 20,017
  • 15
  • 45
  • 64
GBG
  • 9,737
  • 1
  • 15
  • 44
  • Is proj-data installed? – GeoMonkey Jul 26 '23 at 03:19
  • @Geomonkey - I have a directory here that was recently downloaded from Proj: /usr/share/proj/proj-data-1.14/ with a number of tiffs (but no GPX files are included in that directory). I also have this from the terminal in Ubuntu: proj-bin is already the newest version (6.3.1-1) – GBG Jul 26 '23 at 16:36

0 Answers0