nguyenquyhy / Flight-Recorder

Record and replay flights in Microsoft Flight Simulator
https://flightsim.to/file/8163/flight-recorder
GNU General Public License v3.0
207 stars 21 forks source link

Path simplification #108

Open fengzee opened 2 years ago

fengzee commented 2 years ago

Motivation

In https://github.com/nguyenquyhy/Flight-Recorder/issues/106 a KML export feature is on its way. A major use case of the exported KML file is to import it into Google Earth for viewing flight path. However currently data points seems to be captured at frame rate, which is a quite high frequency, producing about 90k samples for a half-hour flight (in one of my tests). This would introduce severe performance issue when imported into Google Earth (or other KML viewing tools). And for flight path only this sample rate is unnecessarily high as between most data points the path line is straight.

Feature description

A "path simplification" feature is preferred when exporting data (to KML or CSV or other formats).

Data points should be dropped by the radius of path curve. More points should be retained when flight is in a sharp curve and less when in a straight flight. Necessary parameters should also be provided to control the simplification behavior, including

fengzee commented 2 years ago

I wrote a standalone script for both https://github.com/nguyenquyhy/Flight-Recorder/issues/106 and https://github.com/nguyenquyhy/Flight-Recorder/issues/108: https://github.com/fengzee/geo-tools/blob/main/src/transformers/simplifyCurve.js. It's a Node script to fulfill my needs to view my flights in Google Earth and Fog of World. It's better to make these features integrated with the Flight-Recorder, but I'm not familiar with .NET stack yet. So still looking forward to your version.