GPSBabel: convert, manipulate, and transfer data from GPS programs or GPS receivers. Open Source and supported on MacOS, Windows, Linux, and more. Pointy clicky GUI or a command line version...
Both these combinations suffered from passing locations in degrees to gcdist instead of the required radians.
For the error option using the overall route length:
the existing code sets a limit of 1000m, but the actual route length changes by -21.459m leaving 333 points.
the modified code set a limit of 20.34m and the actual route length changes by -20.259m leaving 333 points.
the existing and modified code each keep a different set of 333 points.
the change in route length is lower with the modified code than the existing code even though both keep 333 points.
error(m)
total length(km)
delta length(m)
points
garmin-edge-800-output.gpx
25.169843
1286
ref
1000
25.148384
-21.459
333
dut
20.2
25.149752
-20.091
334
dut
20.34
25.149584
-20.259
333
dut
20.5
25.149415
-20.428
332
For the error option using the relative error based on HDOP:
the new simplify-relative test (without the corrections to the call to gcdist) uses a limit of 34.3 and keeps 33 out of 100 points.
the new simplify-relative test with the corrections to the call to gcdist uses a limit of 0.61 and keeps the same 33 points. The limit to keep the same number of points has changed to approximately (pi/180)*34.3 = 0.60.
Both these combinations suffered from passing locations in degrees to gcdist instead of the required radians.
For the error option using the overall route length:
For the error option using the relative error based on HDOP: