Hi,
When generating a route i require the KValues attached to each edge for specific tags. Issue im having is due to this being called multiple times during the route it is adding between 2000-5000ms completion time specifically on the “getKeyValues()”
Is there a better way to do this and reduce the extra MS for completion?
Thanks,
Brandon
The KVStorage is currently not intended for being used in the Weighting (due to its performance but we are working on it).
However the slow down likely does not (only) come from the getKeyValues call and could be also e.g. due to the parseDouble method or other code following in your calcSeconds method…
Hi,
Thanks for the reply, we are looking to swap routing component with GH, our use case depends on having specific values per edge/link. Are there any current better methods to get the KValues (such as avgspeed_forward_condition, etc) at the Weighting level.
Furthermore, is there an ETA for an improved method which you state is currently being worked on as potentially this could halt our integration. Our main drive for the integration is the massive performance increase we will receive for generating routes, but we require implementation of a few key features which are missing to make the integration meet our specification.
Thanks,
Brandon
is there an ETA for an improved method
no 
instead of using the key values you could move the parsing to the preprocessing step so that you do not need to handle complex stuff in the weighting. If you e.g. need this for time dependent restrictions you could store a bit for every hour of the day and in the preprocessing assign true/false to these “hour bits”.
Or better analyze with a profiler where your speed is gone. Oftentimes it is a different location than one thinks.
For example during my import i have a “MaxSpeed:forward”, “MaxSpeed:backward” this correlate to the road speed limit for that link.
How could this be set using the suggestion you provided to avoid using key values?
My other key values would be
“avgspeed:forward:conditional”=>“19.79 @ (Mo-Fr 04:00-07:00); 14.48 @ (Mo-Fr 07:00-09:00); 9.01 @ (Mo-Fr 09:00-12:00); 10.46 @ (Mo-Fr 12:00-14:00); 15.77 @ (Mo-Fr 14:00-16:00); 22.05 @ (Mo-Fr 16:00-19:00); 28.97 @ (Mo-Fr 19:00-22:00); 4.99 @ (Mo-Fr 22:00-04:00); 25.11 @ (Sa-Su 04:00-07:00); 23.17 @ (Sa-Su 07:00-10:00); 24.3 @ (Sa-Su 10:00-14:00); 7.4 @ (Sa-Su 14:00-19:00); 28.0 @ (Sa-Su 19:00-22:00); 30.09 @ (Sa-Su 22:00-04:00)”
As for this timeband, i pass in a time band like “(Mo-Fr 19:00-22:00)” into a custom model, then i would pull out the matching weight “12 @” which is what the road speed is for that link during that time of the day.
Im not entirely sure how i would pull that info out into the weighting process if i preprocess it, this is assigned to the edge during the import.
Thanks,
Brandon