.\" Automatically generated by Pod::Man 4.12 (Pod::Simple 3.39) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "GEOIDEVAL 1" .TH GEOIDEVAL 1 "2020-11-22" "GeographicLib 1.51" "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 above the \s-1WGS84\s0 ellipsoid on standard output. .PP Positions are given as latitude and longitude, \s-1UTM/UPS,\s0 or \s-1MGRS,\s0 in any of the formats accepted by \fBGeoConvert\fR\|(1). (\s-1MGRS\s0 coordinates signify the \&\fIcenter\fR of the corresponding \s-1MGRS\s0 square.) If the \fB\-z\fR option is specified then the specified zone is prepended to each line of input (which must be in \s-1UTM/UPS\s0 coordinates). This allows a file with \s-1UTM\s0 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 geoid \fIname\fR instead of the default \f(CW\*(C`egm96\-5\*(C'\fR. See \&\*(L"\s-1GEOIDS\*(R"\s0. .IP "\fB\-d\fR \fIdir\fR" 4 .IX Item "-d dir" read geoid data from \fIdir\fR instead of the default. See \&\*(L"\s-1GEOIDS\*(R"\s0. .IP "\fB\-l\fR" 4 .IX Item "-l" use bilinear interpolation instead of cubic. See \&\*(L"\s-1INTERPOLATION\*(R"\s0. .IP "\fB\-a\fR" 4 .IX Item "-a" cache the entire data set in memory. See \*(L"\s-1CACHE\*(R"\s0. .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 \s-1SW\s0 corner of the cache and the last two arguments specify the \s-1NE\s0 corner. The \fB\-w\fR flag specifies that longitude precedes latitude for these corners, provided that it appears before \fB\-c\fR. See \*(L"\s-1CACHE\*(R"\s0. .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 \s-1UTM/UPS\s0 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 (\s-1HAE\s0). If \fB\-z\fR \fIzone\fR is specified then the \fIthird\fR token is treated as the height; this makes it possible to convert \s-1LIDAR\s0 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 (\s-1MSL\s0). .IP "\fB\-v\fR" 4 .IX Item "-v" print information about the geoid 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., \*(L"#\*(R" or \*(L"//\*(R"). 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 geoid path and name, 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 \*(L"\-\*(R" 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 \*(L"\-\*(R" 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 \*(L"\s-1INTERPOLATION\*(R"\s0). The following geoid tables 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 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 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 \&\fB\s-1NOTE\s0\fR: all the geoids above apply to the \s-1WGS84\s0 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 \s-1GB\s0 of \s-1RAM.\s0 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 "\fB\s-1GEOGRAPHICLIB_GEOID_NAME\s0\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 \fB\s-1GEOGRAPHICLIB_GEOID_NAME\s0\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 "\fB\s-1GEOGRAPHICLIB_GEOID_PATH\s0\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 \fB\s-1GEOGRAPHICLIB_GEOID_PATH\s0\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 "\fB\s-1GEOGRAPHICLIB_DATA\s0\fR" 4 .IX Item "GEOGRAPHICLIB_DATA" Another way of overriding the compile-time default geoid path. If it is set (and if \fB\s-1GEOGRAPHICLIB_GEOID_PATH\s0\fR is not set), then $\fB\s-1GEOGRAPHICLIB_DATA\s0\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 \*(L"earth gravity model\*(R". The models published by the \s-1NGA\s0 are: .IP "\fB\s-1EGM84\s0\fR" 4 .IX Item "EGM84" An earth gravity model published by the \s-1NGA\s0 in 1984, . .IP "\fB\s-1EGM96\s0\fR" 4 .IX Item "EGM96" An earth gravity model published by the \s-1NGA\s0 in 1996, . .IP "\fB\s-1EGM2008\s0\fR" 4 .IX Item "EGM2008" An earth gravity model published by the \s-1NGA\s0 in 2008, . .IP "\fB\s-1WGS84\s0\fR" 4 .IX Item "WGS84" World Geodetic System 1984, . .IP "\fB\s-1HAE\s0\fR" 4 .IX Item "HAE" Height above the \s-1WGS84\s0 ellipsoid. .IP "\fB\s-1MSL\s0\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 \s-1EGM96\s0 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 \s-1UTM\s0 zone 18n from \s-1MSL\s0 to \s-1HAE\s0 .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.