Hello,
How much default routing car speed for each highways tag (trunk, primary, motorway, etc) and smoothness tag (excellent, good, etc)?
I have read this site graphhopper/custom-models.md at master · graphhopper/graphhopper · GitHub , I still googling it but not found any reference.
For example, if I set custom profile where
{
"speed": [
{
"if": "urban_density == CITY",
"multiply_by": "0.3"
},
{
"if": "urban_density == RESIDENTIAL",
"multiply_by": "0.5"
},
{
"if": "urban_density == RURAL",
"multiply_by": "0.7"
}
]
}
Then what is the number that multiply by graphhopper?
In this picture, If some segment has smoothness tags inside that PBF
file, has the value will calculate by 3 factor?
default speed * urban_density_factor * smoothness_factor * highways_tags_factor
Thanks for any answer
easbar
February 6, 2023, 8:44pm
#2
When you enable ‘Show Routing Graph’ in the layers menu you can hover the roads to see the different road attributes. There should be also car_average_speed
, foot_average_speed
etc. This is the definite speed that will be multiplied with the factors you set in your custom_model.
The speeds depend on the road type and are given here:
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
This file has been truncated. show original
(and similar for the other vehicles/profiles).
But note that besides the road class also maxspeed, the surface of the road etc. might be taken into account and they are multiplied by 0.9
:
protected double applyMaxSpeed(ReaderWay way, double speed, boolean bwd) {
double maxSpeed = getMaxSpeed(way, bwd);
return isValidSpeed(maxSpeed) ? maxSpeed * 0.9 : speed;
}
1 Like
Thanks for detailed answer…
But, I don’t get the car_average_speed
and foot_average_speed
in “show routing graph”. What’s wrong with that?
FYI, I Don’t write custom profile in graphhopper
GUI in localhost:8989 . I wrote that custom profile in config.yaml
.
# config.yaml
graphhopper:
datareader.file: rmy_own_road_network.osm.pbf
graph.location: graphs/my_road_network
profiles:
- name: foot
vehicle: foot
weighting: fastest
- name: car
vehicle: car
weighting: custom
custom_model_file: urban_density.json
- name: bike
vehicle: bike
weighting: custom
custom_model_file: bike3.json
custom_model_folder: custom_models
graph.urban_density.threads: 8
graph.urban_density.residential_radius: 300
graph.urban_density.residential_sensitivity: 60
graph.urban_density.city_radius: 2000
graph.urban_density.city_sensitivity: 30
graph.elevation.provider: srtm
graph.elevation.cache_dir: ./srtmprovider/
graph.vehicles: roads|transportation_mode=HGV,car
graph.encoded_values: max_slope, average_slope, toll,hgv,surface,max_width,max_height
server:
application_connectors:
- type: http
port: 8989
bind_host: localhost
admin_connectors:
- type: http
port: 8990
bind_host: localhost
And the custom profile in urban_density.json
contains
{
"speed": [
{
"if": "urban_density == CITY",
"multiply_by": "0.3"
},
{
"if": "urban_density == RESIDENTIAL",
"multiply_by": "0.5"
},
{
"if": "urban_density == RURAL",
"multiply_by": "0.7"
}
]
}
But, I don’t get the car_average_speed
, urban_density
, etc in “show routing graph” layer.
It is strange ,
If I put empty bracket { }
in custom profile (at localhost:8989), the average_speed
will show but, urban_density
doesn’t show
Whats wrong with my graphhopper?
easbar
February 13, 2023, 7:06pm
#4
You are looking at the urban density layer, not the routing graph layer (or maybe both)? Make sure you enable only the ‘Show Routing Graph’ checkbox, not ‘Show Urban Density’. Then you should be able to hover every single road to see its attributes like this:
which also shows you the speed.
The diagram in the bottom right corner shows different road attributes for the current path.
1 Like
thank you, I will try this week your suggestion. I will create a new thread If I found any problem