Adding a weighted ShortestPath option
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ê
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, weight: number and the function uses that to compare if it exists?
I think that the best option would be an optional argument (default null) in the function call.
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).