Adding a weighted ShortestPath option #2791
Replies: 3 comments
-
Thanks for your suggestion @kauevestena. Do you think it needs to be an entirely new module? Or would it make sense to add some optional weighting parameters to the existing shortestPath call? For example, |
Beta Was this translation helpful? Give feedback.
-
I think that the best option would be an optional argument (default It could be either an string referring to a precomputed field (less flexible), or to a function that could also calculate weights on-the-fly (could be less optimized). |
Beta Was this translation helpful? Give feedback.
-
Agreed with OP. Was just looking into pathing functions/algos and having a weight would be helpful for what I'm trying to accomplish. Thanks for the hard work on this library, it's made my life easier. |
Beta Was this translation helpful? Give feedback.
-
Hello! First of all, congrats for the amazing project!
I found Turf on searching tools for an attempt to create a routing demo and host at github pages, having the computation running on client-side, I found that there's the function "ShortestPath", which would be an amazing beginning. But for my application I would rather have weighted routes, I even have the weights computed in a field of the geojson file.
So this is my suggestion/request,
Best Regards,
Kauê
Beta Was this translation helpful? Give feedback.
All reactions