Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port geosimplify-js #184

Open
1ec5 opened this issue Mar 9, 2022 · 1 comment
Open

Port geosimplify-js #184

1ec5 opened this issue Mar 9, 2022 · 1 comment

Comments

@1ec5
Copy link
Contributor

1ec5 commented Mar 9, 2022

LineString.simplify(tolerance:highestQuality:) and simplified(tolerance:highQuality:) are based on simplify-js, which is fine for certain simplification use cases. However, sampling the input to a map matching algorithm requires interpolating points along a straightaway: mapbox/mapbox-directions-swift#661 (comment). The standard Ramer–Douglas–Peucker algorithm can easily create a space between vertices large enough to result in a gap according to the map matching algorithm.

geosimplify-js is a derivative of simplify-js that preserves points along straightaways. It could be ported to Swift as an alternative to the usual simplification algorithm. Suggested method signatures:

mutating func simplify(minimumOffset: LocationDistance, minimumGap: LocationDistance)
func simplified(minimumOffset: LocationDistance, minimumGap: LocationDistance)

/cc @danpat @Guardiola31337

@1ec5 1ec5 added JS parity feature New feature request. labels Mar 9, 2022
@MaximAlien
Copy link
Contributor

Tagging @mapbox/navigation-android for parity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants