till213 / SkyDolly

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

GPX file format import #16

Closed scls19fr closed 2 years ago

scls19fr commented 2 years ago

Hello,

GPX is a quite used file format for GPS track. Not as used as IGC #15 for gliders but widely used also (SDVFR for example doesn't provide IGC export but KML and GPX export).

Maybe SkyDolly could support GPX as import also https://en.wikipedia.org/wiki/GPS_Exchange_Format

A sample file can be found at https://gist.github.com/scls19fr/36ad147517dfdf1b2d7e1ef34ecc4670

Kind regards

till213 commented 2 years ago

Ha, that's really funny: just hours ago I had a look at the GPX documenation here:

https://www.topografix.com/gpx.asp

I do have a small list of import/export formats on my own TODO list, GPX is one of them.

till213 commented 2 years ago

Just as a heads-up:

grafik

Note that altitude (elevation) and timestamps are optional values in GPX, so the current solution allows to define default values in case either altitude or timestamps are missing.

The timestamps are calculated based on the desired flight speed - which is then of course constant across the whole path. Ignoring the "extra path length" introduced later on by cubic spline interpolation - the distance (and hence the timestamps, given the desired velocity) is purely calculated based on the linear connection of the track points (the Haversine distance, to be specific - so not quite "linear" ;)).