Function simplifyPath
Parameters
- points: [number, number][]
An array of coordinate pairs [longitude, latitude]
- distance: number
The minimum distance between points in the simplified path
Returns [number, number][]
A new array containing a simplified version of the input path
- points: [number, number][]
Was this helpful?
Simplfies a path by removing points that are too close together.
This function first resamples the path based on the average distance between points, then filters out points that are closer than the specified distance from the last included point. The first and last points of the original path are always preserved.