mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-10 07:36:29 +00:00
reduce
This commit is contained in:
1 parent
b29c4cdb08
commit
bec1ce4c9b
13 files changed
+372
-215
No files matched your search
@@ -701,6 +701,24 @@ class Engine {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the trackpoints of the selection that are less than `tolerance` meters away from the
|
||||
* line of their neighbours, except the ends of the segments. Resolves to `false` when there
|
||||
* is nothing to remove.
|
||||
*/
|
||||
reduce(tolerance: number) {
|
||||
return this.run((w) => w.reduce(tolerance));
|
||||
}
|
||||
|
||||
/**
|
||||
* For each trackpoint of the selection, in the order of the statistics, the highest tolerance
|
||||
* (m) of `reduce` that keeps it: infinite for the ends of the segments. Not requested with
|
||||
* the statistics: ask when they changed.
|
||||
*/
|
||||
reductionDistances(): Float64Array {
|
||||
return this.wasm?.reduction_distances() ?? new Float64Array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cuts the file, the track or the segment (see `SplitType`) of the trackpoint `at` of the
|
||||
* selection in two, there: the trackpoint ends the first part and starts the second one. The
|
||||
|
||||
Reference in new issue
Block a user