-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
[FEATURE] Consider Visvalingam-Whyatt algorithm for simplification #1105
Comments
Yes! That would be a great addition. The one issue with JTS library is that it should use a priority queue but instead does a brute force approach to find the next smallest triangle to remove, and probably has some other inefficiencies. It wouldn't be hard to implement an efficient version in planetiler though. That would also give us flexibility to use the effective area weighting function used on https://mapshaper.org Beyond that it's mostly just a question of what the API should look like to switch between DP and VW. Could we specify "strategy=retain effective areas" and somehow transform the DP tolerance to a VW effective area limit? Or maybe we just need a more flexible way to configure the simplification algorithm like the |
Added Visvalingam Whyatt simplification option in #1109. You can opt-into it on a feature by using I'll tackle the |
Looking at the Planetiler codebase, it seems that line simplification is currently done with the Douglas-Peucker algorithm. As an alternative, have you considered the Visvalingam-Whyatt algorithm, which may give better-looking results? Tilemaker seems to be using Visvalingam-Whyatt through a C++ library originally made for Tippecanoe inspired by a Go implementation, but there’s also a Java function in JTS. See also here and here for interactive explanations of the algorithm, and the original paper.
The text was updated successfully, but these errors were encountered: