-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Use dicts and sets in to get junctions #76
Conversation
Fixed. Performance for |
Another possible speed-up - in |
It's super great that you found another approach. I will check it out soon. Hopefully tomorrow otherwise early on in next week. The package started with shapely/geos as base for most of the core functions (shared_paths, split, simplify), but now better variants are appearing in almost all steps, so it's good observation that there are occasions when linestrings are shapely geometries, sometimes numpy arrays or (list of) lists. There is definitely improvement possible based on the input options for different routes within the package. Again, much appreciated that you really dived into the code. |
Regarding
You are right about the I think this is fine than as well for the routine you introduced here in Based on your results I will remove the numpy-based junction detection route from this PR, to avoid confusion. |
I have cleaned the PR to include only dict-based method, and not your numpy one.
According to my timings it is approximately 10x faster than
That would be great! I haven't looked at the logic of Cut. One more thing to consider is the default options for |
I agree that this proposed route should become default. Maybe have to revisit the naming of the settings once have worked up the other objects. |
Oh btw, I accepted the PR. Awesome! |
Hi,
I tried to implement similar algorithm
libpysal
is using, to determine contiguity to get junctions and it seems to be faster than numpy solution in #75. It is based on performant dict/set.Using
naturalearth_lowres
all versions seems to be equal.I haven't tested the correctness of resulting junctions, but simplified gdf looks alright.
The whole diff is between lines 156-189. It is based on #75 to have a comparison.
edit: it is wrong at the moment :) working on it