[ACCEPTED]-How to calculate the altitude above from mean sea level-altitude

Accepted answer
Score: 12

As you mentioned, GPS returns the altitude 28 as an offset from the WGS84 reference ellipsoid, but 27 most people want to see mean sea level (MSL), and 26 the two frequently don't agree. The way 25 this is most frequently done is by looking 24 up the delta in a table and using that to 23 compute MSL based on the height from GPS 22 and the delta in the table.

There's some 21 java code here: https://github.com/NASAWorldWind/WorldWindJava/blob/develop/src/gov/nasa/worldwind/util/EGM96.java. The other functions that 20 it uses from Worldwind aren't that complicated, so 19 you could probably use most of the code 18 unmodified, and the rest you could adapt 17 if you're working in Java and their license 16 meets your needs.

It uses information from 15 the EGM 96 data set (link here if you're interested 14 -- not strictly necessary though), which 13 you can download here: https://github.com/jleppert/egm96/blob/master/WW15MGH.DAC. You will want the 12 WW15MGH.DAC file. It's a binary file full 11 of 16-bit signed integers. You can use the 10 Java example to show you how to access the 9 data in the file. They also provide a Fortran 8 example if that's your thing. :-)

Here's 7 the information on the file from their readme.

Data 6 Description for 15 minute worldwide binary 5 geoid height file:


The 4 total size of the file is 2,076,480 bytes. This 3 file was created using an INTEGER2 data type format and is an unformatted direct access file. The data on the file is arranged in records from north to south. There are 721 records on the file starting with record 1 at 90 N. The last record on the file is at latitude 90 S. For each record, there are 1,440 15 arc-minute geoid heights arranged by longitude from west to east starting at the Prime Meridian (0 E) and ending 15 arc-minutes west of the Prime Meridian (359.75 E). On file, the geoid heights are in units of centimeters. While retrieving the Integer2 values 2 on file, divide by 100 and this will produce 1 a geoid height in meters.

More Related questions