Skip to content

Commit 89fa391

Browse files
authored
Block difficult mtb_rating segments for foot, see discussion in graphhopper#3050 (graphhopper#3073)
* Block difficult mtb_rating segments for foot, see discussion in graphhopper#3050 * Improve documentation for mtb_rating and horse_rating * Changes triggered fram review comments
1 parent 610d426 commit 89fa391

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

core/src/main/resources/com/graphhopper/custom_models/foot.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// to use this custom model you need to set the following option in the config.yml
22
// graph.elevation.provider: srtm # enables elevation
3-
// graph.encoded_values: foot_access, hike_rating, foot_priority, foot_average_speed, average_slope
3+
// graph.encoded_values: foot_access, hike_rating, mtb_rating, foot_priority, foot_average_speed, average_slope
44
// profiles:
55
// - name: foot
66
// custom_model_files: [foot.json, foot_elevation.json]
77

88
{
99
"priority": [
1010
{ "if": "!foot_access || hike_rating >= 2", "multiply_by": "0" },
11+
{ "if": "mtb_rating > 2", "multiply_by": "0" },
1112
{ "else": "", "multiply_by": "foot_priority"}
1213
],
1314
"speed": [

docs/core/custom-models.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ There are also some that take on a numeric value, like:
9898

9999
- average_slope: a number for 100 * "elevation change" / edge_distance for a road segment; it changes the sign in reverse direction; see max_slope
100100
- curvature: "beeline distance" / edge_distance (0..1) e.g. a curvy road is smaller than 1
101-
- hike_rating, horse_rating, mtb_rating: a number from 0 to 6 for the `sac_scale` in OSM, e.g. 0 means "missing", 1 means "hiking", 2 means "mountain_hiking" and so on
101+
- hike_rating: a number from 0 to 6 for the `sac_scale` in OSM, e.g. 0 means "missing", 1 means "hiking", 2 means "mountain_hiking", 3 means demanding_mountain_hiking, 4 means alpine_hiking, 5 means demanding_alpine_hiking, and 5 means difficult_alpine_hiking
102+
- mtb_rating: a number from 0 to 7 for the `mtb:scale` in OSM, e.g. 0 means "missing", 1 means `mtb:scale=0`, 2 means `mtb:scale=1` and so on. A leading "+" or "-" character is ignored.
103+
- horse_rating: a number from 0 to 6 for the `horse_scale` in OSM, e.g. 0 means "missing", 1 means "common", 2 means "demanding", 3 means difficult, 4 means critical, 5 means dangerous, and 6 means impossible
102104
- lanes: number of lanes
103105
- max_slope: a signed decimal for the maximum slope (100 * "elevation change / distance_i") of an edge with `sum(distance_i)=edge_distance`. Important for longer road segments where ups (or downs) can be much bigger than the average_slope.
104106
- max_speed: the speed limit from a sign (km/h)

0 commit comments

Comments
 (0)