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
Results not as expected #13
Comments
From what I can see, this polygon data set is very detailed. Nevertheless, there are several options you can look into:
|
@fitodic Thanks for your suggestion! The results got much better by simplifying the polygon data using Shapely simplify function. |
Glad I could help 🙂 |
I'm facing the same issue plus am quite new to Python thus I'm using the function of Centerline inside R. I have tried Shapely simplify function but still have extra lines at the end as shown in the figure. Any ideas for more improvement? Or how to apply the 1 & 3 option? EDIT: simplifying centerline data set does not remove extra lines at the ends. |
@ahmathlete Hi :) >>> from shapely.geometry import Polygon
>>> from centerline.geometry import Centerline
>>> polygon = Polygon([[0, 0], [0, 4], [4, 4], [4, 0]])
>>> attributes = {"id": 1, "name": "polygon", "valid": True}
>>> centerline = Centerline(polygon, interpolation_distance=1.5, **attributes) You can also pass the same value to the command line script. As to option 3, you create the centerline dataset (e.g. using the |
@fitodic Hello:) Thanks for the helpful tips. Since am doing programmatically for large set of data, I will leave these steps in case someone will need it :
X0, X1, X2 values depend mainly on details of the work and desired results. |
@ahmathlete Thanks for clarifying 🙂 |
Thanks for your library!
I'm trying to use this library to get the centerline of the roads (polygon). However, as the following figure show, besides the centerline, there are many short lines along the centerline. Is there any way to remove these short lines?
The text was updated successfully, but these errors were encountered: