vlarmet / cppRouting

Algorithms for Routing and Solving the Traffic Assignment Problem
109 stars 9 forks source link

feature suggestions #20

Open ischlo opened 8 months ago

ischlo commented 8 months ago

Hello Vincent,

This is not an issue, as I haven't had any serious ones using cppRouring, it's actually phenomenal how good it is. We are publishing a paper soon in which all the routing was done with it. In short, thank you for your work ! I have some feature suggestions and I would be happy to contribute to them if you can use an extra pair of hands. The first one is being able to rout by giving geographic coordinates of points, instead of node ids. This would be very handy, I currently made my own function for that using h3 indexing, and if the data gets very big I run a nearest feature search in a postgis database. I am sure it can be sped up in R with some cpp code specific to the package. Having a cppRouting function do it as fast as a database in R would be truly great. The second feature I would be happy to use and contribute to is a 'network voronoi’ function that from a set of input nodes/coordinates returns a list of sets of nodes from the graph that are nearest to them. Let me know if these seem relevant.

Looking forward to your reply, Best, Ivann

vlarmet commented 8 months ago

Hi,

Thank you for your very positive feedback !

1st feature In my understanding, each spatial point should be assigned with the nearest network node, then run current algorithms. We should look at the RANN package, which is incredibly efficient (memory use and speed) : https://github.com/jefferislab/RANN. Coordinates should be expressed in meters and not angles, just like coords optional argument in makegraph function.
I would be ok to include this feature.

2nd feature
Yes, it would be interesting !

For your information, I plan to work on the following (big) feature : the ability to convert any spatial dataset (shapefiles, osm.pbf, sf ...) into a routable network.

A suivre

ischlo commented 8 months ago

Hi Vincent,

Thank you for your reply, I wasn't aware of RANN and just gave it a try, it's very fast indeed and does exactly what I meant. Having a preprocessing part where provided projected geographic coordinates are linked to the network nodes before routing and the distance added in the result would be a great new functionality (I think dodgr does this as well). It would definitely make sense when using your package with spatial networks and wanting to rout between different kinds of locations without necessarily knowing the underlying nearest node ids (my current use case is computing isodistances from thousands of h3 grid cell centroids, and st_nearest_feature is a big bottleneck at this point as I mentioned). I am happy to give it a try and write a function using RANN and send it to you. Regarding the Network Voronoi, I will likely need to do it as well and can keep you informed.

As for what you are developing, sounds like a huge task ! Not having to import big network shapefiles/pbfs into the environment would be ideal. Good luck !

Best, Ivann

finnwiz commented 6 months ago

Just seconding the commendation for this library. It's incredible! Thank you.