till213 / SkyDolly

Sky Dolly connects with Flight Simulator 2020 and records the flight path and basic instruments for replay.
MIT License
77 stars 9 forks source link

GPX export elevation data inconsistency #160

Closed gaboroszkar closed 1 week ago

gaboroszkar commented 2 weeks ago

Describe the bug GPX export elevation data might be incorrect. Not sure why, but it showed me +42 m at Rotterdam Airport at L apron using the default Cessna 152 aircraft. The elevation using different recording methods show around -1 m elevation there. (Officially the elevation there is -15 ft, but looks like every other software I tried and even the KML export says, that it is not +42 m there, but rather around -1 m, which is much closer to reality than the values in GPX file.)

Inconsistency with KML file. The GPX elevation data is inconsistent with the KML file's elevation data. When I export the same flight in both KML and GPX format, and then import those files in Google Earth Pro, it shows me two paths, and the difference between them is around 40 m (120 ft). (When importing the data in Google Earth Pro, I used "Absolute" as altitude reference in the "Altitude" tab in "Edit Path" window.)

Inconsistency with SimFlightPath. I also recorded a similar path with SimFlightPath (https://flightsim.to/file/15872/simflightpath). The GPX file's elevation data is clearly different. At the same stand, SimFlightPath's exported GPX shows around -1 m, where SkyDolly's exported GPX shows around +42 m.

Inconsistency with Little Navmap. While Little Navmap (https://albar965.github.io/littlenavmap.html) was connected to the sim at the same location, it was recording an Aircraft Trail. (Does this recording automatically when it's connected to the simulator.) I exported this with "File", "GPS Exchange Format (GPX)", "Export Flight Plan and Trail as GPX", and it showed me inconsistent values with SkyDolly.

To Reproduce Steps to reproduce the behavior:

  1. Open Microsoft Flight Simulator 2020 at EHRD (Rotterdam), start at any stand at L apron with Cessna 152.
  2. Open SkyDolly, press "Record".
  3. Move around with the plane.
  4. Then, click on that flight, and export it with "File", "Export", "GPX (GPS Exchange Format)", and click on "Export", and save the file.
  5. Open the same file with Google Earth Pro.
  6. In Google Earth Pro, right click one of the "Path", and click on "Properties", and then in the "Altitude" tab, select "Absolute" as a reference.
  7. In Google Earth Pro, right click one of the "Path", and click on "Show Elevation Profile".

Expected behavior The <ele> tag's value should show around -1 at the stand instead of the current +42, and the elevation at the stand should show around -1 m in the elevation profile in Google Earth Pro.

Application version: "Humble Hawker" (2024.07) Version 0.17.5 (4cf6f06f) Thu Jul 4 12:32:10 2024

Additional context The followings show the Cessna 152 on the ground exported by different applications. They're not exactly the same stand, but all of them are at the same L apron at EHRD.

SkyDolly, first waypoint in the GPX file exported is the following.

      <trkpt lat="51.949519" lon="4.426761">
        <ele>42.22</ele>
        <time></time>
      </trkpt>

SkyDolly, first waypoint in the KML file exported is the following.

<coordinates>
4.426761,51.949519,-1.554070 ...
</coordinates>

SimFlightPath, first waypoint in the GPX file exported is the following.

<trkpt lat="51.94952075" lon="4.42675969"><ele>-1.5537</ele><time>2024-07-07T09:05:52.7505251Z</time></trkpt>

Little Navmap, first waypoint in the GPX file exported is the following.

      <trkpt lon="4.426761" lat="51.949519">
        <ele>-1.56174</ele>
        <time>2024-07-07T06:02:01.888Z</time>
      </trkpt>
till213 commented 1 week ago

Hello,

First of all, thank you for the very detailed report. This is something I can work with!

Yes, altitude... I will have to dive into this topic again a bit deeper, but here is how it is currently implemented in Sky Dolly. And just to let you know that I got your issue and will certainly look into this in more detail.

So yes, there are different ways to measure altitude. From the top of my head:

Then there is the question what the "system" (here: MSFS) actually measures. Sky Dolly currently records two altitude values ("simulation variables") from MSFS (one is "for information / export" purposes only). Unfortunatelly the SimConnect documentation is a bit sparse about the exact definition, but from practical experiments we get:

I just noticed that there is also a "standard pressure altitude" variable, but Sky Dolly is not currently recording it (yet):

This might become useful when trying to align the values with other tools (such as Little Navmap).

And finally there is the question what each file format requires the altitude to be - and in the end what the final application makes out of it (Google Earth Pro has options how to interpret the altitude).

From the GPX format description (e.g. from https://en.wikipedia.org/wiki/GPS_Exchange_Format)

"Latitude and longitude are expressed in decimal degrees, and elevation in meters, both using the WGS 84 datum.[6] Dates and times are expressed in Coordinated Universal Time (UTC) using ISO 8601 format.[1]"

So as the GPX format is mostly produced by "GPS trackers" the altitude is measured in relation to the WGS 84 reference ellipsoid (aka "GPS altitude").

Currently the above "PLANE ALTITUDE" simulation variable comes closest to this definition (but it is not clear at all what "PLANE ALTITUDE" actually is: could be some MSFS specific, internal altitude measurement). But this is the altitude not depending on pressure at all, so at the time I chose this as export value for the GPX format... uh... wait a second ;)

I just said that I assumed PLANE ALTITUDE (the value reported by MSFS) to be "height above some reference ellipsoid" (aka "GPS altitude" - it is even documented as such in my code):

https://github.com/till213/SkyDolly/blob/main/src/Model/include/Model/PositionData.h

struct MODEL_API PositionData final : public TimeVariableData
{
    // Position
    double latitude {0.0};
    double longitude {0.0};
    // GPS altitude
    double altitude {0.0};
    // Indicated pressure altitude (analytical purposes only)
    double indicatedAltitude {0.0};
    ...
};

However I actually convert this altitude - again - from (wrongly assumed?) 'orthometric altitude' (EGM = earth gravity model - taking earth gravity undulation values into account) to reference altitude:

https://github.com/till213/SkyDolly/blob/main/src/Plugins/Flight/Export/GpxExport/src/GpxExportPlugin.cpp

    // Convert height above EGM geoid to height above WGS84 ellipsoid (HAE) [meters]
    const double heightAboveEllipsoid = d->convert.egmToWgs84Ellipsoid(Convert::feetToMeters(positionData.altitude), positionData.latitude, positionData.longitude);

    const QString trackPoint =
"      <trkpt lat=\"" % Export::formatCoordinate(positionData.latitude) % "\" lon=\"" % Export::formatCoordinate(positionData.longitude) % "\">\n"
"        <ele>" % Export::formatNumber(heightAboveEllipsoid).toUtf8() % "</ele>\n"
"        <time>" % dateTimeUtc.toString(Qt::ISODate) % "</time>\n"
"      </trkpt>\n";

-> You could try and remove the "undulation values" file from the Sky Dolly Resources\geoids directory (simply remove/rename that entire geoids subdirectory)

With that "undulation values" resource file (which is really optional: Sky Dolly properly checks its existence) removed the heights are not converted at all. Like this you would get the "raw PLANE ALTITUDE" value in the exported GPX file.

And yes, in case of the KML export I indeed simply export the "PLANE ALTITUDE" value "as is" (and mark it as "absolute altitude" value in the KML file). So if this gives the expected value ("-1.5 metres") then I will adjust the GPX export plugin as well!

Is the exported height then more sensible?

Again, I am not quite sure what PLANE ALTITUDE really is ("GPS altitude" or "orthometric altitude above the geoid"), but I remember having had discussions about it with some other developer... but I cannot remember its outcome.

But when you say that the expected altitude at that point is really "-1.5 metres" (instead of "+42 metres") then this conversion is probably wrong

till213 commented 1 week ago

So I looked into this a bit further: It is actually quite hard to get information about the GPX format, specifically about its actual units. For instance the official documentation https://www.topografix.com/GPX/1/1/ is mostly concerned about the document structure (XML), but does not say a word about "WGS84" or anything related to units.

So the only source that I have right now is the English Wikipedia entry:

Latitude and longitude are expressed in decimal degrees, and elevation in meters, both using the WGS 84 datum.[6] Dates and times are expressed in Coordinated Universal Time (UTC) using ISO 8601 format.[1]

Or in other words: the elevation (altitude) values in the GPX format are meant to be "alitude above the WGS84 reference ellipsoid" (that is my understanding anyway).

That being said, I now believe that the simulation variable "PLANE ALTITDUE" (as reported by MSFS) is not really a "GPS altitude", but rather an "altitude above mean sea level" (but pressure independent). This is supported by the fact that it reports -1.5 metres for the airport in Rotherdam, which is slightly below sea level. So that makes sense.

However when we measure the altitude with reference to the WGS84 reference ellipsoid at this coordinate (as given in your example GXP output above) we get indeed:

https://geographiclib.sourceforge.io/cgi-bin/GeoidEval?input=51.949519+4.426761&option=Submit

Geoid height:

lat lon = [51.94952 4.42676](http://tools.wmflabs.org/geohack/geohack.php?params=51.94952;4.42676) (51°56'58"N 004°25'36"E)
geoid heights (m)
    [EGM2008](https://earth-info.nga.mil/index.php?dir=wgs84&action=wgs84#tab_egm2008) = 43.7702
    [EGM96](https://earth-info.nga.mil/index.php?dir=wgs84&action=wgs84#tab_egm96)   = 43.5173
    [EGM84](https://earth-info.nga.mil/index.php?dir=wgs84&action=wgs84#tab_egm84)   = 43.5032

And here we have (roughly) our "42 metres" (here: 43 metres), and this is (to my understanding) the "altitude of the geoid ("altitude above mean sea level") above the WGS84 reference ellipsoid". Or in other words: those "42 (43) metres" is the elevation that we should report in the GPX file, according to its description given on Wikipedia anyway.

Now the altitude system in KML (Google Earth) does work a bit different: it does not take the WGS84 reference ellipsoid into account at all (and so it does not convert the imported GPX elevation values using some "undulation map", as it should). In fact, it has its own "reference system", as follows:

https://developers.google.com/kml/documentation/altitudemode?hl=en

Now while all those "altitude modes" have a very practical use when it comes to defining "waypoint markers" none of those modes is directly applicable ("compatible") with the WGS84 reference ellipsoid altitudes. So when you import a GPX file and choose "ABSOLUTE" this is probably your best choice, but it will take the elevation values "as is" (without conversion from the WGS84 reference ellispoid back to the geoid altitude), as it seems.

Long story short: while Sky Dolly seems to do the right thing when it comes to convert "AIRPLANE ALTITUDE" ("altitude above sea level" - to be confirmed by practical experiments) to WGS84 reference ellipsoid altitudes this seems to have only "academic value" (and comes at the cost of an almost 20 MiB large egm2008-5.ppm file - earth gravity model from 2008 - the one with the lowest available resolution, that is).

For the very least I might provide an export option for the altitudes for the GPX exporter (and perhaps also the IGC exporter, see below):

By the way, the initial reason to export proper WGS84 altitudes was the IGC = International Gliding Commision file format that also specifices WGS84 altitudes - but even there I have seen files that clearly do not follow this specificiation, but rather provide "standard pressure altitudes".

-> As a current "workaround" you can simply remove that earth gravity model file egm2008-5.ppm and no conversion will be done (as suggested before)

I will have to think of a proper, user-friendly and practical solution here (perhaps getting rid of this earth gravity model file/conversion altogether, also saving 20 MiB worth of disk space again...)

till213 commented 1 week ago

Marking this issue as "enhancement" rather than "bug", because currently Sky Dolly does "what it is supposed (designed) to do" - but that does not give satisfactory results in practice and hence should be improved (rather than "fixed" ;)).

till213 commented 1 week ago

Fun fact: there are other tools with the exact same "altitude conversion problem", e.g. here:

https://github.com/googlemaps/android-maps-utils/issues/704

Quote:

"On Android, the Location API provides location altitude in WGS84 (*)

However, this is problematic if you want to display this altitude to end users, who are more commonly familiar with MSL altitude. In fact, if you display WGS84 altitude to users, many of them will report this as an error in altitude."

(*) Which makes absolute sense: the GPS system is built around the World Geodetic System (WGS84), so the reported altitudes are "altitude above the reference ellipsoid". And since GPX is a format for GPS data exchange, it is just a natural extension that the reported values are also in relation to the WGS84 reference ellipsoid - and hence not "altitude above mean sea level" (= values which are more practical for end users, and are hence also used in tools such as Google Earth).

Anyway, I will think of a more practical, user-friendly solution. For now you may also just use the Sky Dolly KML exporter: the Sky Dolly KML exporter does export the "AIRPLANE ALTITUDE" as-is, without any conversion (and marks the altitude values as "ABSOLUTE", which comes closest to the MSFS altitude model, I believe).

Summary:

gaboroszkar commented 1 week ago

Hi Oliver,

thank you for the exhaustive and clear explanation. First of all, I'm not familiar with all of these standards, I did a few searches on the web to try to get to the bottom of it myself too.

I really do appreciate that this software tries to be accurate even in these difficult conditions (where documentation and standards don't really exist, or very difficult to find). Very difficult, and there is no ultimate right answer.

Please correct me if I'm wrong, I really have very little experience with this information.

Recommendation for resolution

All in all, I think GPX files should still use the height above mean sea level (geoid) in the <ele> field instead of the height above WGS84.

There are two messages from Dan Foster (who maintains the reference documentation at https://topografix.com), which are relevant here I think. He says he defined <ele> to mean elevation above mean sea level.

https://www.topografix.com/gpx_mailing_list.asp#080404685.20020916130853@topografix.com

Re: [gpsxml] Describing datum
egroups+topografix.com on Mon Sep 16 10:14:53 2002 ([link](https://www.topografix.com/gpx_mailing_list.asp#080404685.20020916130853@topografix.com)), [replying to msg](https://www.topografix.com/gpx_mailing_list.asp#am2bsr+tor7@eGroups.com)
[...]
<ele> Elevation - I didn't define this very precisely in the
documentation.  It means what you think it means - the height, in
meters above mean sea level, of an object.

<geoidheight> Height, in meters, of WGS-84 earth ellipsoid above mean
sea level at the point. (This value is useful if you're processing the
NMEA GGA message)

https://www.topografix.com/gpx_mailing_list.asp#156410363.20090407134425@topografix.com.

egroups+topografix.com on Tue Apr 07 10:52:22 2009 ([link](https://www.topografix.com/gpx_mailing_list.asp#156410363.20090407134425@topografix.com)), [replying to msg](https://www.topografix.com/gpx_mailing_list.asp#grfgr2+c7rh@eGroups.com)
[...]
Dan Foster wrote:
[gpsxml] Re: explanation of <ele> is unclear
[...]
In instances where you have both <ele> and
<geoidheight>, you can calculate this:
h = height above WGS84 ellipsoid
ele = height above mean sea level (geoid)
geoidheight = Height of geoid (mean sea level) above WGS84 ellipsoid

so, h = ele + geoidheight

And if you have <ele> but not <geoidheight>, you're out of luck.  You
won't be able to do your calculations with the correct height data,
unless you've got your own table of geoidheight values for the Earth.

It's also worth reading some of the other messages there. Seems like there's a lot of confusion over this <ele> tag, and there is no consensus among all software out there; however looking at this message from the "official source" (if you can call it that), and the majority of software, it seems like they use <ele> for mean sea level, even if there are some exceptions.

About <geoidheight>: seems like very few applications support it, I think most of them simply ignore it.

Wikipedia wrong?

I think that wikipedia page should also be changed. I think the following quote from https://en.wikipedia.org/wiki/GPS_Exchange_Format#Units is wrong, and I don't even see explicitly that elevation means the WGS84 elevation in the wikipedia's source (https://docs.safe.com/fme/html/FME-Form-Documentation/FME-ReadersWriters/gpxx/gpxx.htm). The wikipedia page currently says the following.

Latitude and longitude are expressed in decimal degrees, and elevation in meters, both using the WGS 84 datum

You can even see a discussion there, which also suggests it is the altitude above mean sea level. https://en.wikipedia.org/wiki/Talk:GPS_Exchange_Format#%3Cele%3E?

What is the "<ele>4.46</ele>" in the "Sample GPX Document" good for? [...] (talk) 07:14, 2 January 2010 (UTC)

> It's for elevation. In this case, less than 5 metres above sea level. There's more information about the spec at the given link. [...] (talk) 00:38, 21 January 2010 (UTC)

PLANE ALTITUDE reported by MSFS

You're right, I agree, it's most probably something very close to the mean sea level altitude. I've just looked at the AIP for Rotterdam Airport.

https://eaip.lvnl.nl/web/2024-05-02-AIRAC/html/eAIP/EH-AD-2.EHRD-en-GB.html#ehrd-ad-2.2

Elevation/reference temperature: -14 FT AMSL/20.8(AUG).
Geoid undulation at AD ELEV PSN: 143 FT.

https://eaip.lvnl.nl/web/2024-05-02-AIRAC/html/eAIP/EH-GEN-2.1-en-GB.html#gen-2-1-vertical

The geoid model used for height transformation is Normaal Amsterdams Peil (NAP), for practical purposes equivalent to the Earth Gravitational Model 1996 (EGM96).

If I understand this correctly, EGM96 is one of the standards for mean sea level, and this suggests that around 43.6 m (143 ft) is the elevation above mean sea level there, so AIP also agrees with what you've said.

Conclusion

I really like that this software (and you) strive for a very high standard, and I can see why it's such a difficult topic. I also agree with you on changing this from "bug" to "enhancement", because this topic can be subjective. Thanks again for all the sources, explanation, it also helps me a lot to understand this "mess", but it is very interesting. Also, looking at your code, nice, very clean, and elegant.

Even though I think <ele> should be above mean sea level, I like your idea of "provide an export option", maybe a checkbox that's by default on (if the checkbox is for above mean sea level), or by default off (if the checkbox is for WSG84 altitude).

Thanks, Gabor.

till213 commented 1 week ago

Hello Gábor,

Wow! Thank you so much for all the research you have done: this helps a lot!

All in all, I think GPX files should still use the height above mean sea level (geoid) in the <ele> field instead of the height above WGS84.

You are absolutely right! First, the (English) Wikipedia is also extremely sparse when it says "using the WGS 84 datum." The German page does not even mention that.

But the post that you have found - again, thanks so much! - makes it absolutely clear:

<ele> Elevation - I didn't define this very precisely in the
documentation.  It means what you think it means - the height, in
meters above mean sea level, of an object.

-> So: (elevation) is meters above mean sea level - essentially the "AIRPLANE ALTITUDE" value (and what also Little Navmap is exporting)

And the fact alone that the following variant exists (I wasn't even aware about this tag):

<geoidheight> Height, in meters, of WGS-84 earth ellipsoid above mean
sea level at the point. (This value is useful if you're processing the
NMEA GGA message)

already illustrates that the "ele" tag value must be something different than the "geoid height".

Where the "geoid height" is calculated based on the reference ellipsoid and the "undulation values, as done by the "GeographicLib" that Sky Dolly is using. Essentially this value that can also be evaluated online:

https://geographiclib.sourceforge.io/cgi-bin/GeoidEval?input=51.949519+4.426761&option=Submit

I will fix both the export and import (which I strongly assume does the inverse - and wrong - conversion as well). So there is no strong need for an option, except that I may think about adding an option which would still allow to export the "geoidheight" value - and I will also support this tag in the import (when present - and then the conversion would have to be applied, but only then).

I will convert this issue into a bug issue again - because now it clearly is a bug.

gaboroszkar commented 1 week ago

Hi Oliver,

thanks for the quick reply! Great, then the GPX file will be consistent with everything I use!

One thing here could be problematic (not for me, but for older users), if they try to reimport an already exported GPX file (which was exported by Sky Dolly), then this fix will be strange, that they exported, then imported something, and their plane is not on the ground. I don't know your software's legacy/deprecation policy. But as I've said, I'm perfectly happy if import/export only uses the mean sea levels only.

when present - and then the conversion would have to be applied

I don't fully understand this. If from now on the <ele> will mean height above mean sea level, then in the subsequent versions you shouldn't convert those values in the <ele>, because they'll correspond to the "PLANE ALTITUDE" values, right? And the <geoidheight> values can only be found in the subsequent versions of Sky Dolly. So: where <geoidheight> is present, you'll never have to do any conversion. Or did I overlook something?

Thanks, Gábor.

till213 commented 1 week ago

One thing here could be problematic (not for me, but for older users), if they try to reimport an already exported GPX file (which was exported by Sky Dolly), then this fix will be strange, that they exported, then imported something, and their plane is not on the ground.

Yes, that is a valid point. However:

But yes, in general I try to maintain backwards compatibility, even during this "preview" (alpha) phase. But when it comes to a "clean bug fix" then I prefer the "clean code" for now, even if this means some breaking behaviour change.

As a side-note, there exists a related issue:

https://github.com/till213/SkyDolly/issues/27

This one is about the imported altitude being off by several metres as well. This is due to the fact that flightradar24.com and flightaware.com (and others) report their altitude values in "standard pressure altitude" values (only - at least in their free service. The paid subscription also provides "radar altitudes", or so I understand).

In other words: the imported flights are not aligned on the ground either - so Sky Dolly users are currently used to that fact. This will be fixed by some "interactive wizard dialog" that aligns the aircraft on the ground, based on the actual ground altitude in MSFS (I have to place the aircraft at each of those coordinates - "interactively" - and align the aircraft "on ground").

I don't fully understand this. If from now on the <ele> will mean height above mean sea level, then in the subsequent versions you shouldn't convert those values in the <ele>, because they'll correspond to the "PLANE ALTITUDE" values, right?

That is correct. I was now talking about the subsequent <geoidheight> value only.

And the <geoidheight> values can only be found in the subsequent versions of Sky Dolly. So: where <geoidheight> is present, you'll never have to do any conversion. Or did I overlook something?

When importing a GPX file (that can really come from anywhere) I will check for the optional <geoidheight> tag (just like the <ele> tag is also optional). I will prefer the <ele> value, but if only the <geoidheight> is present then I will import this value - but then a conversion is again necessary from "geoid height to altitude above sea level" (= the inverse conversion that I currently do when exporting GPX), or in other words: from "geoid height to PLANE ALTITUDE". At least this is my current understanding.

But again: <ele> values won't need any conversion anymore, neither when exporting nor importing. That's correct.

till213 commented 1 week ago

References (internal note):

gaboroszkar commented 1 week ago

I prefer the "clean code" for now, even if this means some breaking behaviour change

Agree. Wish it was possible to do it everytime, in every codebase. :)

I will prefer the value, but if only the is present then I will import this value - but then a conversion is again necessary from "geoid height to altitude above sea level" (= the inverse conversion that I currently do when exporting GPX)

Not sure I agree. I think the <geoidheight> means not the elevation of the aircraft from the WGS 84 ellipsoid, but rather the elevation of the mean sea level relative to the WGS 84 ellipsoid. So the elevation of the aircraft from the WGS 84 ellipsoid is the (value in <geoidheight>) + (value in <ele>). But if you'd like to get the elevation of the aircraft from mean sea level, the value in <geoidheight> shouldn't be used at all.

(Or maybe we misunderstand each other, I think what you're saying is that the <geoidheight> is the aircraft's elevation above the WGS 84 ellipsoid, which would be wrong I think.)

till213 commented 1 week ago

Not sure I agree. I think the <geoidheight> means not the elevation of the aircraft from the WGS 84 ellipsoid, but rather the elevation of the mean sea level relative to the WGS 84 ellipsoid. So the elevation of the aircraft from the WGS 84 ellipsoid is the (value in <geoidheight>) + (value in <ele>). But if you'd like to get the elevation of the aircraft from mean sea level, the value in <geoidheight> shouldn't be used at all.

Again, you are absolutely spot on and correct. In fact, I just came to the exact same conclusion after doing some more research and was just about to write it down (again, as an "internal note").

In fact we have, from https://www.topografix.com/gpx_mailing_list.asp#156410363.20090407134425@topografix.com:

I realize that you need the height above the ellipsoid to do precise
calculations.  In instances where you have both <ele> and
<geoidheight>, you can calculate this:
h = height above WGS84 ellipsoid
ele = height above mean sea level (geoid)
geoidheight = Height of geoid (mean sea level) above WGS84 ellipsoid

so, h = ele + geoidheight

And if you have <ele> but not <geoidheight>, you're out of luck.  You
won't be able to do your calculations with the correct height data,
unless you've got your own table of geoidheight values for the Earth.

So it is absolutely as you say: the <geoidheight> contains simply the difference between the "geoid" (roughly the same as "mean sea level") and the WGS84 reference ellipoid - but not the actual waypoint (or trackpoint) altitude. The later is always given in the <ele> tag, which is "elevation above mean sea level", and corresponds to what we have in AIRPLANE ALTITUDE.

So:

till213 commented 1 week ago

An "export geoid height" option will be added, allowing to - optionally - also export the new <geoidheight> tag, with the geoid height ("difference of the geoid and the reference ellipsoid") calculated at the same lat/lon position:

grafik

The geoid height corresponds essentially to N1 and N2 in the following illustration:

ortho_ellip_geoid_height

With this option enabled we get for instance:

Waypoint:

<wpt lat="51.950283" lon="4.428136">
  <ele>-1.56</ele>
  <time>2024-07-09T11:07:11.000Z</time>
  <geoidheight>43.77</geoidheight>
  <name>CUSTD</name>
</wpt>

Trackpoint:

<trkpt lat="51.950283" lon="4.428136">
  <ele>-1.56</ele>
  <time>2024-07-09T11:07:11.000Z</time>
  <geoidheight>43.77</geoidheight>
</trkpt>

Note: the time is also properly calculated now, specifically when exporting "all aircraft into single file" - including proper time zone suffix (= proper ISO 8601 date time format).

The <geoidheight> values correspond to the values as calculated by the GeographicLib (with the lowest resolution undulation/EGM2008 file egm2008-5.pgm, found in [app folder]\Resources\geoids), which can also be evaluated online:

https://geographiclib.sourceforge.io/cgi-bin/GeoidEval?input=51.950283+4.428136&option=Submit

till213 commented 1 week ago

When importing this GPX path into Google Earth Pro we do not get perfect results, but much better ones:

grafik

till213 commented 1 week ago

Fix will be part of upcoming Sky Dolly v0.18

gaboroszkar commented 1 week ago

Thank you very much Oliver! Very nice and quick support. Great, looking forward to the compiled and built version, will download when ready! Very nice software and work.

till213 commented 1 week ago

Very nice software and work.

Thank you very much! You know what I like so much about it (besides the actual programming aspect): you buy a flight simulator, one moment later you browse through official A320 documents on the web and the next moment you're deep into geodesy, digging into undulations and flight physics (in order to better calculate the bank angle for imported flights - but that is a separate story yet to come :))

gaboroszkar commented 1 week ago

You know what I like so much about it (besides the actual programming aspect): you buy a flight simulator, one moment later you browse through official A320 documents on the web and the next moment you're deep into geodesy

Exactly! I learn so much about a lot of things. Aviation really touches on a lot of subjects like engineering, international law, physics, geography, etc. 😃