Skip to content

Commit

Permalink
Block difficult mtb_rating segments for foot, see discussion in graph…
Browse files Browse the repository at this point in the history
…hopper#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
  • Loading branch information
ratrun authored Oct 29, 2024
1 parent 610d426 commit 89fa391
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// to use this custom model you need to set the following option in the config.yml
// graph.elevation.provider: srtm # enables elevation
// graph.encoded_values: foot_access, hike_rating, foot_priority, foot_average_speed, average_slope
// graph.encoded_values: foot_access, hike_rating, mtb_rating, foot_priority, foot_average_speed, average_slope
// profiles:
// - name: foot
// custom_model_files: [foot.json, foot_elevation.json]

{
"priority": [
{ "if": "!foot_access || hike_rating >= 2", "multiply_by": "0" },
{ "if": "mtb_rating > 2", "multiply_by": "0" },
{ "else": "", "multiply_by": "foot_priority"}
],
"speed": [
Expand Down
4 changes: 3 additions & 1 deletion docs/core/custom-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ There are also some that take on a numeric value, like:

- average_slope: a number for 100 * "elevation change" / edge_distance for a road segment; it changes the sign in reverse direction; see max_slope
- curvature: "beeline distance" / edge_distance (0..1) e.g. a curvy road is smaller than 1
- 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
- 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
- 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.
- 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
- lanes: number of lanes
- 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.
- max_speed: the speed limit from a sign (km/h)
Expand Down

0 comments on commit 89fa391

Please sign in to comment.