[GraphHopper] Duration tag

Andreas Wolf dev at a-w.io
Fri May 15 10:00:58 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Jean,

Am 11.05.2015 um 23:16 schrieb jean hilda:
> As we didn't find out where to replace Integer by Float in the 
> encodedvalue, we have tried to set a higher maxspeed and thus 
> multiplicate everywhere by 1000 the speed in our osm file in order
> to get speed > 5 for the ferry (afterward we thought be able to
> divide Time obtained for the shortest way by 1000 ...)
> 
> Is the change for precision has to be done in the encodedvalue or 
> doubleencodedvalue ? (We use carflagencoder) After replacing 5 by
> 0.5, how can we change integer by float ?

it should be fine to just use EncodedDoubleValue instead of
EncodedValue if you need to store a floating point value.


> On another subject but quite close : is there a simple method to
> use graphhopper to find fastest path without calculating speed;
> only with using duration of each way ? (No speed, No distance). The
> purpose is to find out the best delivery itinerary according to
> driving time we know for each way (our drivers have entered for
> every road between 2 delivery points, the usual driving Time witch
> is more precise for us than setting a speed on ways).

The question is if you have this information available on a per-road
basis or if the ways for which the times were entered are overlapping.
For the former, you could just recalculate the speed to be length /
entered time. For the latter, this problem is IMO not really solvable
without redoing the routing graph, as you would need to replace the
edges with your "custom" edges based on the driving time.

As for implementing the time-based routing: I think you should be fine
by implementing your own Weighting instance, which can then use the
delay that was encoded as edge flags before. See
<https://github.com/jansoe/graphhopper/blob/TrafficLights2/core/src/main
/java/com/graphhopper/routing/util/FastestDelayWeighting.java>
for an example of such a custom Weighting implementation.

Regards
Andreas


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iF4EAREIAAYFAlVVw9oACgkQRJlqDhrZfp14EgD6Au9dXRBmuLLTZPpmsG/CDjee
yf1UeX6SSZ2ySR910CcA/1yRmj106BRtfm4QGS6jwxM9rc4AgdUmeSzWe8pUEvFQ
=TQS6
-----END PGP SIGNATURE-----



More information about the GraphHopper mailing list