-
Notifications
You must be signed in to change notification settings - Fork 57
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
improve simplify function #12
Comments
Have you looked at https://pypi.python.org/pypi/rdp/? |
had not seen it. seems pretty new. will look into it |
adding contents of #21: I originally used R because I found code that reduces the amount of corners in a geographic polygon: http://rpubs.com/geospacedman/alphasimple The function in the vectorizer is: and the R code: Ideally, we would eliminate R and have python code that produces the same output as R (one shapefile for each polygon that was simplified that is within the area threshold). A shapefile-per-polygon is produced (thousands!) because it was the only way I could pass data from python-to-R-and-back but was also useful to find the average color of the polygon. |
Explore the possibility of making R unnecessary by implementing a Ramer–Douglas–Peucker or Visvalingam algorithm directly in Python. A Python implementation done by @migurski: https://github.com/migurski/bloch
See line 223: https://github.com/NYPL/map-vectorizer/blob/master/vectorize_map.py#L223 and
simplify_map.R
: https://github.com/NYPL/map-vectorizer/blob/master/simplify_map.Rvia @albertsun
The text was updated successfully, but these errors were encountered: