[GraphHopper] Building Distance Matrix offline

Peter graphhopper at gmx.de
Wed Dec 10 12:31:29 UTC 2014


Hi Giampaolo,

> So if i decrement these values the result is an increase  in travel
time is right?

yes that is correct.

> Are they expressed in Km/h (e.g. motorway ? 100Km/h)?

Yes. And yes 100km/h seems slow for motorway but we use mean values
here. And they could be decreased by max_speed tags or even increased
(for cars only).

Also keep in mind that this issue is still open:
https://github.com/graphhopper/graphhopper/issues/230

Regards,
Peter

On 10.12.2014 13:20, Giampaolo wrote:
> Thanks for the answer Peter :)
>
> Studying the code I realized that in the
> class com.graphhopper.routing.util.CarFlagEncoder we have :
>
> + // autobahn
>
> 	
> 	+ defaultSpeedMap.put("motorway", 100);
>
> 	
> 	+ defaultSpeedMap.put("motorway_link", 70);
>
> 	
> 	+ // bundesstraße
>
> 	
> 	+ defaultSpeedMap.put("trunk", 70);
>
> 	
> 	+ defaultSpeedMap.put("trunk_link", 65);
>
> 	
> 	+ // linking bigger town
>
> 	
> 	+ defaultSpeedMap.put("primary", 65);
>
> 	
> 	+ defaultSpeedMap.put("primary_link", 60);
>
> 	
> 	+ // linking towns + villages
>
> 	
> 	+ defaultSpeedMap.put("secondary", 60);
>
> 	
> 	+ defaultSpeedMap.put("secondary_link", 50);
>
> 	
> 	+ // streets without middle line separation
>
> 	
> 	+ defaultSpeedMap.put("tertiary", 50);
>
> 	
> 	+ defaultSpeedMap.put("tertiary_link", 40);
>
> 	
> 	+ defaultSpeedMap.put("unclassified", 30);
>
> 	
> 	+ defaultSpeedMap.put("residential", 30);
>
> 	
> 	+ // spielstraße
>
> 	
> 	+ defaultSpeedMap.put("living_street", 5);
>
> 	
> 	+ defaultSpeedMap.put("service", 20);
>
> 	
> 	+ // unknown road
>
> 	
> 	+ defaultSpeedMap.put("road", 20);
>
> 	
> 	+ // forestry stuff
>
> 	
> 	+ defaultSpeedMap.put("track", 15);
>
>
> So in the hashMap defaultSpeedMap we have the default speed values for
> each type of highway (http://wiki.openstreetmap.org/wiki/Key:highway)
> and i suppose that these values are used to calculate travel times of
> each route.
> Are they expressed in Km/h (e.g. motorway ? 100Km/h)? So if i
> decrement these values the result is an increase  in travel time is right?
>
> Thank for your help
>
> Giampaolo
>
> 2014-11-27 13:22 GMT+01:00 Peter <graphhopper at gmx.de
> <mailto:graphhopper at gmx.de>>:
>
>     This is a known issue and will be fixed soon:
>     https://github.com/graphhopper/graphhopper/issues/230
>
>     Regards,
>     Peter
>
>     On 27.11.2014 13:19, Giampaolo wrote:
>>     Hi Peter,
>>
>>     thanks for your answer,I managed to build distance and time matrix :)
>>
>>     I have a question about values returned from res.getMillis() :
>>     they are  always lower than the values provided by google maps or
>>     bing.
>>
>>     As example , a route of 3,7 Km in the center of Milan city is :
>>
>>     10 Min - GoogleMaps
>>     8 Min - Bing
>>     About 4 Min - my time matrix
>>
>>     these values are referred to routes without traffic.How can I
>>     make my values consistent with those?
>>
>>
>>
>>     2014-11-23 15:31 GMT+01:00 Peter <graphhopper at gmx.de
>>     <mailto:graphhopper at gmx.de>>:
>>
>>         Hi Giampaolo,
>>
>>         you need to get the route information like distance and time
>>         from the hopper.route() call like in this example:
>>         https://github.com/karussell/optaplanner-graphhopper-example/blob/master/src/main/java/com/graphhopper/optaplanner/Main.java#L59
>>
>>         Regards,
>>         Peter
>>
>>
>>
>>         On 23.11.2014 14:38, Giampaolo wrote:
>>>
>>>         Hi all J,
>>>
>>>         My name is Giampaolo, I’m currently trying to build a
>>>         Distance Matrix offline, based on Italy’region OSM Map, using GH
>>>
>>>         As a first step I’ve run the main.java successfully ,my
>>>         sourcefile is lombardia.pbf (the region that contains Milan
>>>         city) , then I pass the GHPoint(45.4974413, 9.1865076) of a
>>>         station point placed inside the city, then I call
>>>         hopper.route().
>>>         At the end of the process, it generates  some files like
>>>         edges, names, nodes etc …
>>>
>>>         Now , how can I read/open the files created? All the path
>>>         from the GHPoint to all other nodes of the map are placed
>>>         inside these files?
>>>
>>>
>>>         thanks a lot for your support!
>>>
>>>         Giampaolo
>>
>
>
>     _______________________________________________
>     GraphHopper mailing list
>     GraphHopper at openstreetmap.org <mailto:GraphHopper at openstreetmap.org>
>     https://lists.openstreetmap.org/listinfo/graphhopper
>
>
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/graphhopper

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20141210/9aab495f/attachment.html>


More information about the GraphHopper mailing list