.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "GEOIDEVAL 1" .TH GEOIDEVAL 1 2023-07-25 "GeographicLib 2.3" "GeographicLib Utilities" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME GeoidEval \-\- look up geoid heights .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBGeoidEval\fR [ \fB\-n\fR \fIname\fR ] [ \fB\-d\fR \fIdir\fR ] [ \fB\-l\fR ] [ \fB\-a\fR | \fB\-c\fR \fIsouth\fR \fIwest\fR \fInorth\fR \fIeast\fR ] [ \fB\-w\fR ] [ \fB\-z\fR \fIzone\fR ] [ \fB\-\-msltohae\fR ] [ \fB\-\-haetomsl\fR ] [ \fB\-v\fR ] [ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] [ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] [ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] [ \fB\-\-line\-separator\fR \fIlinesep\fR ] [ \fB\-\-output\-file\fR \fIoutfile\fR ] .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBGeoidEval\fR reads in positions on standard input and prints out the corresponding heights of the geoid model above the WGS84 ellipsoid on standard output. .PP Positions are given as latitude and longitude, UTM/UPS, or MGRS, in any of the formats accepted by \fBGeoConvert\fR\|(1). (MGRS coordinates signify the \&\fIcenter\fR of the corresponding MGRS square.) If the \fB\-z\fR 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. .PP More accurate results for the geoid height are provided by \fBGravity\fR\|(1). This utility can also compute the direction of gravity accurately. .PP The height of the geoid above the ellipsoid, \fIN\fR, is sometimes called the geoid undulation. It can be used to convert a height above the ellipsoid, \fIh\fR, to the corresponding height above the geoid (the orthometric height, roughly the height above mean sea level), \fIH\fR, using the relations .Sp .RS 4 \&\fIh\fR = \fIN\fR + \fIH\fR, \ \ \fIH\fR = \-\fIN\fR + \fIh\fR. .RE .SH OPTIONS .IX Header "OPTIONS" .IP "\fB\-n\fR \fIname\fR" 4 .IX Item "-n name" use \fIname\fR for the geoid model instead of the default \f(CW\*(C`egm96\-5\*(C'\fR. See "GEOIDS". .IP "\fB\-d\fR \fIdir\fR" 4 .IX Item "-d dir" read geoid data from \fIdir\fR instead of the default. See "GEOIDS". .IP \fB\-l\fR 4 .IX Item "-l" use bilinear interpolation instead of cubic. See "INTERPOLATION". .IP \fB\-a\fR 4 .IX Item "-a" cache the entire data set in memory. See "CACHE". .IP "\fB\-c\fR \fIsouth\fR \fIwest\fR \fInorth\fR \fIeast\fR" 4 .IX Item "-c south west north east" cache the data bounded by \fIsouth\fR \fIwest\fR \fInorth\fR \fIeast\fR in memory. The first two arguments specify the SW corner of the cache and the last two arguments specify the NE corner. The \fB\-w\fR flag specifies that longitude precedes latitude for these corners, provided that it appears before \fB\-c\fR. See "CACHE". .IP \fB\-w\fR 4 .IX Item "-w" toggle the longitude first flag (it starts off); if the flag is on, then when reading geographic coordinates, longitude precedes latitude (this can be overridden by a hemisphere designator, \fIN\fR, \fIS\fR, \fIE\fR, \fIW\fR). .IP "\fB\-z\fR \fIzone\fR" 4 .IX Item "-z zone" prefix each line of input by \fIzone\fR, e.g., \f(CW\*(C`38n\*(C'\fR. This should be used when the input consists of UTM/UPS eastings and northings. .IP \fB\-\-msltohae\fR 4 .IX Item "--msltohae" 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). If \fB\-z\fR \fIzone\fR is specified then the \fIthird\fR token is treated as the height; this makes it possible to convert LIDAR data where each line consists of: easting northing height intensity. .IP \fB\-\-haetomsl\fR 4 .IX Item "--haetomsl" this is similar to \fB\-\-msltohae\fR except that the height token is treated as a height (in meters) above the ellipsoid and the output echoes the input line with the height converted to height above the geoid (MSL). .IP \fB\-v\fR 4 .IX Item "-v" print information about the geoid model on standard error before processing the input. .IP "\fB\-\-comment\-delimiter\fR \fIcommentdelim\fR" 4 .IX Item "--comment-delimiter commentdelim" set the comment delimiter to \fIcommentdelim\fR (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space). .IP \fB\-\-version\fR 4 .IX Item "--version" print version and exit. .IP \fB\-h\fR 4 .IX Item "-h" print usage, the default path and name for geoid models, and exit. .IP \fB\-\-help\fR 4 .IX Item "--help" print full documentation and exit. .IP "\fB\-\-input\-file\fR \fIinfile\fR" 4 .IX Item "--input-file infile" read input from the file \fIinfile\fR instead of from standard input; a file name of "\-" stands for standard input. .IP "\fB\-\-input\-string\fR \fIinstring\fR" 4 .IX Item "--input-string instring" read input from the string \fIinstring\fR instead of from standard input. All occurrences of the line separator character (default is a semicolon) in \fIinstring\fR are converted to newlines before the reading begins. .IP "\fB\-\-line\-separator\fR \fIlinesep\fR" 4 .IX Item "--line-separator linesep" set the line separator character to \fIlinesep\fR. By default this is a semicolon. .IP "\fB\-\-output\-file\fR \fIoutfile\fR" 4 .IX Item "--output-file outfile" write output to the file \fIoutfile\fR instead of to standard output; a file name of "\-" stands for standard output. .SH GEOIDS .IX Header "GEOIDS" \&\fBGeoidEval\fR computes geoid heights by interpolating on the data in a regularly spaced table (see "INTERPOLATION"). The following geoid grids are available (however, some may not be installed): .PP .Vb 9 \& bilinear error cubic error \& name geoid grid max rms max rms \& egm84\-30 EGM84 30\*(Aq 1.546 m 70 mm 0.274 m 14 mm \& egm84\-15 EGM84 15\*(Aq 0.413 m 18 mm 0.021 m 1.2 mm \& egm96\-15 EGM96 15\*(Aq 1.152 m 40 mm 0.169 m 7.0 mm \& egm96\-5 EGM96 5\*(Aq 0.140 m 4.6 mm .0032 m 0.7 mm \& egm2008\-5 EGM2008 5\*(Aq 0.478 m 12 mm 0.294 m 4.5 mm \& egm2008\-2_5 EGM2008 2.5\*(Aq 0.135 m 3.2 mm 0.031 m 0.8 mm \& egm2008\-1 EGM2008 1\*(Aq 0.025 m 0.8 mm .0022 m 0.7 mm .Ve .PP By default, the \f(CW\*(C`egm96\-5\*(C'\fR geoid model is used. This may changed by setting the environment variable \f(CW\*(C`GEOGRAPHICLIB_GEOID_NAME\*(C'\fR or with the \fB\-n\fR option. The errors listed here are estimates of the quantization and interpolation errors in the reported heights compared to the specified geoid. .PP The geoid model data will be loaded from a directory specified at compile time. This may changed by setting the environment variables \&\f(CW\*(C`GEOGRAPHICLIB_GEOID_PATH\*(C'\fR or \f(CW\*(C`GEOGRAPHICLIB_DATA\*(C'\fR, or with the \&\fB\-d\fR option. The \fB\-h\fR option prints the default geoid path and name. Use the \fB\-v\fR option to ascertain the full path name of the data file. .PP Instructions for downloading and installing geoid data are available at . .PP \&\fBNOTE\fR: all the geoids above apply to the WGS84 ellipsoid (\fIa\fR = 6378137 m, \fIf\fR = 1/298.257223563) only. .SH INTERPOLATION .IX Header "INTERPOLATION" Cubic interpolation is used to compute the geoid height unless \fB\-l\fR 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 .PP .Vb 4 \& . 1 1 . \& 1 2 2 1 \& 1 2 2 1 \& . 1 1 . .Ve .PP 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. .SH CACHE .IX Header "CACHE" 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 \fB\-c\fR \fIsouth\fR \fIwest\fR \fInorth\fR \&\fIeast\fR to notify \fBGeoidEval\fR to read a rectangle of data into memory; heights within the this rectangle can then be computed without any disk access. If \fB\-a\fR is specified all the geoid data is read; in the case of \f(CW\*(C`egm2008\-1\*(C'\fR, 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 \fB\-v\fR option to verify the size of the cache. .PP Regardless of whether any cache is requested (with the \fB\-a\fR or \fB\-c\fR 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. .SH ENVIRONMENT .IX Header "ENVIRONMENT" .IP \fBGEOGRAPHICLIB_GEOID_NAME\fR 4 .IX Item "GEOGRAPHICLIB_GEOID_NAME" Override the compile-time default geoid name of \f(CW\*(C`egm96\-5\*(C'\fR. The \fB\-h\fR option reports the value of \fBGEOGRAPHICLIB_GEOID_NAME\fR, if defined, otherwise it reports the compile-time value. If the \fB\-n\fR \fIname\fR option is used, then \fIname\fR takes precedence. .IP \fBGEOGRAPHICLIB_GEOID_PATH\fR 4 .IX Item "GEOGRAPHICLIB_GEOID_PATH" Override the compile-time default geoid path. This is typically \&\f(CW\*(C`/usr/local/share/GeographicLib/geoids\*(C'\fR on Unix-like systems and \&\f(CW\*(C`C:/ProgramData/GeographicLib/geoids\*(C'\fR on Windows systems. The \fB\-h\fR option reports the value of \fBGEOGRAPHICLIB_GEOID_PATH\fR, if defined, otherwise it reports the compile-time value. If the \fB\-d\fR \fIdir\fR option is used, then \fIdir\fR takes precedence. .IP \fBGEOGRAPHICLIB_DATA\fR 4 .IX Item "GEOGRAPHICLIB_DATA" Another way of overriding the compile-time default geoid path. If it is set (and if \fBGEOGRAPHICLIB_GEOID_PATH\fR is not set), then $\fBGEOGRAPHICLIB_DATA\fR/geoids is used. .SH ERRORS .IX Header "ERRORS" An illegal line of input will print an error message to standard output beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBGeoidEval\fR to return an exit code of 1. However, an error does not cause \fBGeoidEval\fR to terminate; following lines will be converted. .SH ABBREVIATIONS .IX Header "ABBREVIATIONS" The geoid is usually approximated by an "earth gravity model". The models published by the NGA are: .IP \fBEGM84\fR 4 .IX Item "EGM84" An earth gravity model published by the NGA in 1984, . .IP \fBEGM96\fR 4 .IX Item "EGM96" An earth gravity model published by the NGA in 1996, . .IP \fBEGM2008\fR 4 .IX Item "EGM2008" An earth gravity model published by the NGA in 2008, . .IP \fBWGS84\fR 4 .IX Item "WGS84" World Geodetic System 1984, . .IP \fBHAE\fR 4 .IX Item "HAE" Height above the WGS84 ellipsoid. .IP \fBMSL\fR 4 .IX Item "MSL" 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.) .SH EXAMPLES .IX Header "EXAMPLES" The height of the EGM96 geoid at Timbuktu .PP .Vb 2 \& echo 16:46:33N 3:00:34W | GeoidEval \& => 28.7068 \-0.02e\-6 \-1.73e\-6 .Ve .PP The first number returned is the height of the geoid and the 2nd and 3rd are its slopes in the northerly and easterly directions. .PP Convert a point in UTM zone 18n from MSL to HAE .PP .Vb 2 \& echo 531595 4468135 23 | GeoidEval \-\-msltohae \-z 18n \& => 531595 4468135 \-10.842 .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBGeoConvert\fR\|(1), \fBGravity\fR\|(1), \fBgeographiclib\-get\-geoids\fR\|(8). .PP An online version of this utility is availbable at . .SH AUTHOR .IX Header "AUTHOR" \&\fBGeoidEval\fR was written by Charles Karney. .SH HISTORY .IX Header "HISTORY" \&\fBGeoidEval\fR was added to GeographicLib, , in 2009\-09.