-
Notifications
You must be signed in to change notification settings - Fork 954
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
turf-polygonreduce (optimal label anchor) #240
Comments
Updated with improved version |
Deployed to production environment, "fine" = true: great performance and accuracy! |
Closing, since the feature in question has been built as a module. We'll work on getting this into a release in the future. Thanks again |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was labeling polygons in their centers, centroids, barycenters..., and guess what? There's an issue with concave or pierced polygons.
To sort it out, I've made this function to find the deepest point within a polygon (Pole of inaccessibility) through negative buffering iterations. This way the label is always placed inside the polygon and in the best place to avoid collisions with other labels.
As far as I've tested, the performance hit is barely noticeable even with complex polygons.
EDIT (2015-03-22):
New version with "fine" parameter, cleaner code, and some performance tweaks
NOTES:
The text was updated successfully, but these errors were encountered: