GeoidEval -- look up geoid heights
GeoidEval [ -n name ] [ -d dir ] [ -l ] [ -a | -c south west north east ] [ -z zone ] [ --msltohae ] [ --haetomsl ] [ -v ] [ --version | -h | --help ]
GeoidEval in positions on standard input and print out the corresponding geoid heights on standard output. In addition print the northerly and easterly gradients of the geoid height (i.e., the rate at which the geoid height changes per unit distance along the WGS84 ellipsoid in the specified directions).
Positions are given as latitude and longitude, UTM/UPS, or MGRS, in
any of the formats accepted by GeoConvert(1)
. (MGRS coordinates signify
the center of the corresponing MGRS square.) If the -z option is
specified then the specified zone is prepended to each line of input
(which must be in UTM/UPS coordinates). This allows a file with UTM
eastings and northings in a single zone to be used as standard input.
use geoid name instead of the default egm96-5
. See GEOIDS.
read geoid data from dir instead of the default. See GEOIDS.
use bilinear interpolation instead of cubic. See INTERPOLATION.
cache the entire data set in memory. See CACHE.
cache the data bounded by south west north east in memory. See CACHE.
prefix each line of input by zone, e.g., 38N
. This should be used
when the input consists of UTM/UPS eastings and northings.
standard input should include a final token on each line which is treated as a height (in meters) above the geoid and the output echoes the input line with the height converted to height above ellipsoid (HAE).
standard input should include a final token on each line which is treated as a height (in meters) above the ellipsoid and the output echoes the input line with the height converted to height above geoid.
print information about the geoid on standard error before processing the input.
print version.
print usage.
print full documentation.
GeoidEval computes geoid heights by interpolating on the data in a regularly spaced table (see INTERPOLATION). The following geoid tables are available (however, some may not be installed):
bilinear error cubic error name geoid grid max rms max rms egm84-30 EGM84 30' 1.546m 70mm 0.274m 14mm egm84-15 EGM84 15' 0.413m 18mm 0.020m 1mm egm96-15 EGM96 15' 1.152m 40mm 0.169m 7mm egm96-5 EGM96 5' 0.140m 5mm 0.003m 1mm egm2008-5 EGM2008 5' 0.478m 12mm 0.294m 5mm egm2008-2_5 EGM2008 2.5' 0.135m 3mm 0.031m 1mm egm2008-1 EGM2008 1' 0.025m 1mm 0.003m 1mm
By default, the egm96-5
geoid is used. This may changed by setting
the environment variable GEOID_NAME
or with the -n option. The
errors listed here are estimates of the quantization and interpolation
errors in the reported heights compared to the specified geoid.
The geoid data will be loaded from a directory specified at compile
time. This may changed by setting the environment variable
GEOID_PATH
or with the -d option. Use the -v option to
ascertain the full path name of the data file.
Instructions for downloading and installing geoid data are available at http://geographiclib.sf.net/html/geoid.html#geoidinst.
NOTE: all the geoids above apply to the WGS84 ellipsoid (a = 6378137m, f = 1/298.257223563) only.
Cubic interpolation is used to compute the geoid height unless -l is specified in which case bilinear interpolation is used. The cubic interpolation is based on a least-squares fit of a cubic polynomial to a 12-point stencil
. 1 1 . 1 2 2 1 1 2 2 1 . 1 1 .
The cubic is constrained to be independent of longitude when evaluating the height at one of the poles. Cubic interpolation is considerably more accurate than bilinear; however it results in small discontinuities in the returned height on cell boundaries. The gradients are computed by differentiating the interpolated results.
By default, the data file is randomly read to compute the geoid heights
at the input positions. Usually this is sufficient for interactive use.
If many heights are to be computed, use -c south west north
east to notify GeoidEval to read a rectangle of data into memory;
heights within the this rectangle can then be computed without any disk
access. If -a is specified all the geoid data is read; in the case
of egm2008-1
, this requires about 0.5 GB of RAM. The evaluation of
heights outside the cached area causes the necessary data to be read
from disk. Use the -v option to verify the size of the cache.
Regardless of whether any cache is requested (with the -a or -c options), the data for the last grid cell in cached. This allows the geoid height along a continuous path to be returned with little disk overhead.
Override the compile-time default geoid name of egm96-5
. If the
-n name option is used then name takes precedence.
Override the compile-time default geoid path. This is typically
/usr/local/share/GeographicLib/geoids
on Unix or Linux systems and
C:/cygwin/usr/local/share/GeographicLib/geoids
on Windows systems.
If the -d dir option is used then dir takes precedence.
An illegal line of input will print an error message to standard output
beginning with ERROR:
and causes GeoidEval to return an exit code
of 1. However, an error does not cause GeoidEval to terminate;
following lines will be converted.
The geoid is usually approximated by an "earth gravity model". The models published by the NGA are:
An earth gravity model published by the NGA in 1984, http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html.
An earth gravity model published by the NGA in 1996, http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html.
An earth gravity model published by the NGA in 2008, http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008.
World Geodetic System 1984, http://en.wikipedia.org/wiki/WGS84.
Height above the WGS84 ellipsoid.
Mean sea level, used as a convenient short hand for the geoid. (However, typically, the geoid differs by a few meters from mean sea level.)
The height of the EGM96 geoid at Timbuktu
echo "16d46'33N" "3d00'34W" | GeoidEval => 28.7068 -0.02e-6 -1.73e-6
The first number returned is the height of the geoid and the 2nd and 3rd are its slopes in the northerly and easterly directions.
Convert a point in UTM zone 18N from MSL to HAE
echo 531595 4468135 23 | GeoidEval --msltohae -z 18N => 531595 4468135 -10.842
GeoConvert(1)
. GeoidEval is a part of GeographicLib,
http://geographiclib.sf.net.
GeoidEval was written by Charles Karney.