Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Country specific highway access. fixes Project-OSRM / osrm-backend #6710 #7013

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
680120f
Add files via upload
tombay Aug 6, 2024
916f167
Add files via upload
tombay Aug 6, 2024
5de0479
Update CHANGELOG.md
tombay Aug 6, 2024
b969f13
Update profiles.md
tombay Aug 6, 2024
144311b
Update profiles.md
tombay Aug 6, 2024
334a8eb
Update profiles.md
tombay Aug 6, 2024
e89d116
Update countrybicycle.lua
tombay Aug 6, 2024
07d9c83
Update country_speeds.lua
tombay Aug 6, 2024
3174f48
Update countrybicycle.lua
tombay Aug 6, 2024
d7387b3
Update countryfoot.lua
tombay Aug 6, 2024
d855e08
Add files via upload
tombay Aug 6, 2024
1e6c213
comment out uselocation tag
tombay Aug 9, 2024
e66d1f4
Add files via upload
tombay Aug 9, 2024
7f4b0a8
Add files via upload
tombay Aug 9, 2024
688b50b
Mention use-location tags
tombay Aug 9, 2024
3e4287b
Update profiles.md
tombay Aug 9, 2024
fc0c2a0
comment uselocation for ttests and -1 means false
tombay Aug 10, 2024
f2c6bb0
speeds from car not needed
tombay Aug 10, 2024
bb315b9
need speeds for every highway type
tombay Aug 10, 2024
fef688c
cleanup debug steps
tombay Aug 10, 2024
97e8962
Add files via upload
tombay Aug 10, 2024
6805055
Update countrybicycle.lua
tombay Aug 10, 2024
109994c
pedestrian should be walking_speed
tombay Aug 11, 2024
19d54d7
Update country_speeds.lua
tombay Aug 11, 2024
dd1466d
remove vehicle profile
tombay Aug 11, 2024
d257782
Delete profiles/countrycar.lua
tombay Aug 12, 2024
7c184e6
remove countryvehicle profile
tombay Aug 12, 2024
872396e
remove countryvehicle profile
tombay Aug 12, 2024
68c6dc5
fix comment
tombay Aug 12, 2024
3a57bd8
missed the comma
tombay Aug 12, 2024
a3915bf
Update countrybikespeeds.feature
tombay Aug 13, 2024
4ac8e20
Update countryspeeds.feature
tombay Aug 13, 2024
e9e2373
Add files via upload
tombay Aug 13, 2024
843a6ec
Delete data/osmb.geojson.gz
tombay Aug 13, 2024
7eb952d
multicountry geojson is possible
tombay Aug 13, 2024
8838260
Update bad_turn.lua
tombay Aug 20, 2024
93dc26a
Update bad_turn.lua
tombay Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Unreleased
- Changes from 5.27.1
- Features
- ADDED: Routing profiles to support country differences [#7013](https://github.com/Project-OSRM/osrm-backend/pull/7013)
- ADDED: Route pedestrians over highway=platform [#6993](https://github.com/Project-OSRM/osrm-backend/pull/6993)
- REMOVED: Remove all core-CH left-overs [#6920](https://github.com/Project-OSRM/osrm-backend/pull/6920)
- ADDED: Add support for a keepalive_timeout flag. [#6674](https://github.com/Project-OSRM/osrm-backend/pull/6674)
Expand Down
19 changes: 19 additions & 0 deletions docs/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,22 @@ There are a few helper functions defined in the global scope that profiles can u
- `trimLaneString`
- `applyAccessTokens`
- `canonicalizeStringList`

### Profiles for country differences
Some countries have differing access rules for different transport types. (https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access_restrictions). Profiles countrybicycle and countryfoot may be used as starting points for country support.

To enable support add 'countryspeeds' to the uselocationtags Set. e.g.

uselocationtags = Set
{
'countryspeeds',
}

Country Specific location data (geojson geometry) should be provided to the osrm-extract for example:

osrm-extract --profile ../profiles/countryfoot.lua --location-dependent-data ../data/osmb.geojson

osrm-extract --profile ../profiles/countrybicycle.lua --location-dependent-data ../mygeojson/Netherlands.geojson

If you enable the tag but provide no location-dependent-data, the profile will use the 'Worldwide' settings. (https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access_restrictions#Worldwide)

186 changes: 186 additions & 0 deletions features/countrybicycle/access.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
@routing @countrybicycle @access
Feature: Bike - Access tags on ways
# Reference: http://wiki.openstreetmap.org/wiki/Key:access

Background:
Given the profile "countrybicycle"

Scenario: Bike - Access tag hierarchy on ways
Then routability should be
| highway | access | vehicle | bicycle | bothw |
| primary | | | | cycling |
| primary | yes | | | cycling |
| primary | no | | | |
| primary | | yes | | cycling |
| primary | | no | | |
| primary | no | yes | | cycling |
| primary | yes | no | | |
| primary | | | yes | cycling |
| primary | | | no | |
| primary | no | | yes | cycling |
| primary | yes | | no | |
| primary | | no | yes | cycling |
| primary | | yes | no | |

@todo
Scenario: Bike - Access tag in forward direction
Then routability should be
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
| primary | | | | cycling | |
| primary | yes | | | cycling | |
| primary | no | | | | |
| primary | | yes | | cycling | |
| primary | | no | | | |
| primary | no | yes | | cycling | |
| primary | yes | no | | | |
| primary | | | yes | cycling | |
| primary | | | no | | |
| primary | no | | yes | cycling | |
| primary | yes | | no | | |
| primary | | no | yes | cycling | |
| primary | | yes | no | | |
| runway | | | | cycling | |
| runway | yes | | | cycling | |
| runway | no | | | | |
| runway | | yes | | cycling | |
| runway | | no | | | |
| runway | no | yes | | cycling | |
| runway | yes | no | | | |
| runway | | | yes | cycling | |
| runway | | | no | | |
| runway | no | | yes | cycling | |
| runway | yes | | no | | |
| runway | | no | yes | cycling | |
| runway | | yes | no | | |

@todo
Scenario: Bike - Access tag in backward direction
Then routability should be
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
| primary | | | | | cycling |
| primary | yes | | | | cycling |
| primary | no | | | | |
| primary | | yes | | | cycling |
| primary | | no | | | |
| primary | no | yes | | | cycling |
| primary | yes | no | | | |
| primary | | | yes | | cycling |
| primary | | | no | | |
| primary | no | | yes | | cycling |
| primary | yes | | no | | |
| primary | | no | yes | | cycling |
| primary | | yes | no | | |
| runway | | | | | cycling |
| runway | yes | | | | cycling |
| runway | no | | | | |
| runway | | yes | | | cycling |
| runway | | no | | | |
| runway | no | yes | | | cycling |
| runway | yes | no | | | |
| runway | | | yes | | cycling |
| runway | | | no | | |
| runway | no | | yes | | cycling |
| runway | yes | | no | | |
| runway | | no | yes | | cycling |
| runway | | yes | no | | |

Scenario: Bike - Overwriting implied acccess on ways
Then routability should be
| highway | access | vehicle | bicycle | bothw |
| cycleway | | | | cycling |
| runway | | | | |
| cycleway | no | | | |
| cycleway | | no | | |
| cycleway | | | no | |
| runway | yes | | | cycling |
| runway | | yes | | cycling |
| runway | | | yes | cycling |

Scenario: Bike - Access tags on ways
Then routability should be
| access | vehicle | bicycle | bothw |
| | | | cycling |
| yes | | | cycling |
| permissive | | | cycling |
| designated | | | cycling |
| some_tag | | | cycling |
| no | | | |
| private | | | |
| agricultural | | | |
| forestry | | | |
| delivery | | | |
| | yes | | cycling |
| | permissive | | cycling |
| | designated | | cycling |
| | some_tag | | cycling |
| | no | | |
| | private | | |
| | agricultural | | |
| | forestry | | |
| | delivery | | |
| | | yes | cycling |
| | | permissive | cycling |
| | | designated | cycling |
| | | some_tag | cycling |
| | | no | |
| | | private | |
| | | agricultural | |
| | | forestry | |
| | | delivery | |
| | | use_sidepath | |

Scenario: Bike - Access tags on both node and way
Then routability should be
| access | node/access | bothw |
| yes | yes | cycling |
| yes | no | |
| yes | some_tag | cycling |
| no | yes | |
| no | no | |
| no | some_tag | |
| some_tag | yes | cycling |
| some_tag | no | |
| some_tag | some_tag | cycling |

Scenario: Bike - Access combinations
Then routability should be
| highway | access | vehicle | bicycle | forw | backw |
| runway | private | | yes | cycling | cycling |
| footway | | no | permissive | cycling | cycling |
| motorway | | | yes | cycling | |
| track | forestry | | permissive | cycling | cycling |
| cycleway | yes | designated | no | | |
| primary | | yes | private | | |
| residential | permissive | | no | | |

Scenario: Bike - Ignore access tags for other modes
Then routability should be
| highway | boat | motor_vehicle | moped | bothw |
| river | yes | | | |
| cycleway | no | | | cycling |
| runway | | yes | | |
| cycleway | | no | | cycling |
| runway | | | yes | |
| cycleway | | | no | cycling |

Scenario: Bike - Bridleways when access is explicit
Then routability should be
| highway | horse | foot | bicycle | bothw |
| bridleway | | | yes | cycling |
| bridleway | | yes | | pushing bike |
| bridleway | designated | | | |
| bridleway | | | | |

Scenario: Bike - Tram with oneway when access is implicit
Then routability should be
| highway | railway | access | oneway | forw | backw |
| residential | tram | | yes | cycling | pushing bike |
| service | tram | psv | yes | cycling | pushing bike |

Scenario: Bike - Access combinations
Then routability should be
| highway | access | bothw |
| primary | permissive | cycling |
| steps | permissive | cycling |
| footway | permissive | cycling |
| garbagetag | permissive | cycling |
68 changes: 68 additions & 0 deletions features/countrybicycle/access_node.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
@routing @countrybicycle @access
Feature: Bike - Access tags on nodes
# Reference: http://wiki.openstreetmap.org/wiki/Key:access

Background:
Given the profile "countrybicycle"

Scenario: Bike - Access tag hierarchy on nodes
Then routability should be
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
| | | | | cycling |
| yes | | | | cycling |
| no | | | | |
| | yes | | | cycling |
| | no | | | |
| no | yes | | | cycling |
| yes | no | | | |
| | | yes | | cycling |
| | | no | | |
| | | no | crossing | cycling |
| no | | yes | | cycling |
| yes | | no | | |
| | no | yes | | cycling |
| | yes | no | | |

Scenario: Bike - Overwriting implied acccess on nodes doesn't overwrite way
Then routability should be
| highway | node/access | node/vehicle | node/bicycle | bothw |
| cycleway | | | | cycling |
| runway | | | | |
| cycleway | no | | | |
| cycleway | | no | | |
| cycleway | | | no | |
| runway | yes | | | |
| runway | | yes | | |
| runway | | | yes | |

Scenario: Bike - Access tags on nodes
Then routability should be
| node/access | node/vehicle | node/bicycle | bothw |
| | | | cycling |
| yes | | | cycling |
| permissive | | | cycling |
| designated | | | cycling |
| some_tag | | | cycling |
| no | | | |
| private | | | |
| agricultural | | | |
| forestry | | | |
| delivery | | | |
| | yes | | cycling |
| | permissive | | cycling |
| | designated | | cycling |
| | some_tag | | cycling |
| | no | | |
| | private | | |
| | agricultural | | |
| | forestry | | |
| | delivery | | |
| | | yes | cycling |
| | | permissive | cycling |
| | | designated | cycling |
| | | some_tag | cycling |
| | | no | |
| | | private | |
| | | agricultural | |
| | | forestry | |
| | | delivery | |
34 changes: 34 additions & 0 deletions features/countrybicycle/alley.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@routing @countrybicycle @alley
Feature: Bicycle - Route around alleys

Background:
Given the profile file "countrybicycle" initialized with
"""
profile.properties.weight_name = 'cyclability'
"""

Scenario: Bicycle - Avoid taking alleys
Given the query options
| annotations | nodes |

Given the node map
"""
a-----b-----c
| : |
d.....e.....f
"""

And the ways
| nodes | highway | service |
| abc | residential | |
| def | service | alley |
| ad | residential | |
| be | service | alley |
| cf | residential | |

When I route I should get
| from | to | a:nodes | weight | # |
| a | f | 1:2:3:6 | 196.2 | Avoids d,e,f |
| a | e | 1:2:5 | 172.2 | Take the alley b,e if neccessary |
| d | f | 4:1:2:3:6 | 248.4 | Avoids the alley d,e,f |

Loading