-
Notifications
You must be signed in to change notification settings - Fork 200
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
Add Visvalingam-Whyatt line-simplification algorithm #84
Conversation
Also use borrowed values in area calculation
Awesome, thanks for doing this! I'm a little busy, but I'll try to look at this sometime this weekend unless someone else wants to review this :) |
WIP until I can verify against PostGIS
The result matches the output of running ST_SimplifyVW on PostGIS
Hmm this is odd; the test passes on my machine (x86_64, OS X):
I don't know where the extra point ( |
FWIW, I can replicate the error Travis is getting on x86_64 macOS. |
After |
Thanks! |
Regarding this question, I think what you have is fine for now. Might change in the future though. |
🎊 |
This is an initial pass at the implementation of the Visvalingam-Whyatt line-simplification algorithm.
This implementation is partially based on a pre-v1.0 version written by @huonw, and uses his method of storing retained points in a "linked list", updating it as necessary. I'm not sure if there's a cleaner way of doing this, but I'm open to ideas.
I'd also like to test the output of this algorithm against a more complex LineString using PostGIS – there are several other extant implementations in various languages, but I don't completely trust them.
Another issue is the provision of the
epsilon
parameter; in this case, it refers to the minimum triangle area to retain, and it's somewhat unintuitive compared tordp
(although PostGIS provides the same API).Other questions:
simplify.rs
module, instead of its own?