UDST / pandana

Pandas Network Analysis by UrbanSim: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:
http://udst.github.io/pandana
GNU Affero General Public License v3.0
385 stars 84 forks source link

[WIP] Range queries #167

Closed ljwolf closed 2 years ago

ljwolf commented 3 years ago

Hey folks, really looking forward to the functionality in the pandana/range-queries branch being merged. So... I've rebased it onto the development branch, added docstrings and tests, and finalised the return value to follow the pattern from nearest_pois().

The todos in cyaccess.pyx were well placed: I found that if you precompute to a given distance, the function would return all pairs within the precomputed distance, regardless of the radius. I tried to fix this in 63f01ff, but that resulted in bad destination ids & weights (my c++ knowledge only comes from troubleshooting Stan models 🤓, so I'm no expert). So, now, the radius filter happens in a pandas query after the results are returned. This is wasteful, so I'd be grateful to learn how to implement this directly within src/accessibility.cpp.

knaaptime commented 3 years ago

this would be killer in the next release! let me know if there's anything i can do to help facilitate :)

knaaptime commented 2 years ago

hey folks, just wanted to check in and see if you're up for merging this and cutting a new release. We'd love to use this new feature :). Happy to help in any way I can

smmaurer commented 2 years ago

This is awesome, thanks @ljwolf!! Read through the code and ran the tests on my machine and it looks great. I'm going to merge this and release it along with a couple of the other outstanding PRs.

Sorry it's languished unmerged for so long. We've had limited resourcing but are trying to get more organized.

knaaptime commented 1 year ago

sorry it took me so long to circle back, but its sweet to see this merged @smmaurer. Any chance to cut a new release with the latest? I'd be happy to help however I can!

With these enhancements we can get pandana-backed network spatial weights in libpysal 😎