#gis

egm2008

Earth Gravitational Model (EGM2008)

1 unstable release

0.1.0 Nov 1, 2023

#190 in Geospatial

Download history 4/week @ 2024-07-28 6/week @ 2024-08-04 12/week @ 2024-08-11 13/week @ 2024-08-18 4/week @ 2024-08-25 28/week @ 2024-09-01 62/week @ 2024-09-08 38/week @ 2024-09-15 43/week @ 2024-09-22 38/week @ 2024-09-29 19/week @ 2024-10-06 42/week @ 2024-10-13 25/week @ 2024-10-20 3/week @ 2024-10-27 25/week @ 2024-11-03

97 downloads per month

BSD-3-Clause

75KB
827 lines

Earth Gravitational Model (EGM2008)

The coordinate system used by GPS is WGS 84, which expresses altitudes as a "height above ellipsoid". Because this ellipsoid is a mathematical simplification, the height given by GPS does not necessarily reflect the height above the actual ground beneath.

The Earth Gravitational Models published by the National Geospatial Intelligence Agency are a way to approximate how high an altitude given in WGS 84 coordinates truly is above the ground.

This library includes data derived from EGM 2008 along with an interpolation function. Together, these allow for an approximate offset to be obtained for arbitrary points on the globe.

The geoid.rs file containing terrain data is generated using the Fortran program provided by NGA.

Updating geoid.rs

The src/geoid.rs file is generated by a Python script (generate.py) that runs NGA's Fortran interpolation program. In order to run the script, you'll need to download the EGM model data from the NGA's website.

You will also need to install gfortran. There are a few ways to do this:

  • On macOS, through Homebrew with brew install gfortran.
  • Use the included Nix dev shell with nix develop.

For convenience, you can run generate_geoid.sh which will download and verify the model data from NGA, compile the interpolation program, and update src/geoid.rs.

Dependencies

~275–750KB
~18K SLoC