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 - Project-OSRM / osrm-backend #7038 #7022

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 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
8cbef36
Global geojson data for country profiles
tombay Sep 16, 2024
90ab073
A geojson from poly files at geofabrik
tombay Sep 17, 2024
f90c90c
update Ireland to remove Northern Island
tombay Sep 17, 2024
41fa698
handle avoid motorway for foot and bicycle
tombay Sep 20, 2024
f193b7c
support country in foot.lua and bicycle.lua
tombay Sep 26, 2024
81ec7a1
Merge branch 'Project-OSRM:master' into master
tombay Oct 3, 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
20 changes: 20 additions & 0 deletions docs/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,23 @@ 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/allthecountries.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)

It is possible to to include multiple countries in the location data file through the use of a FeatureCollection.
89 changes: 89 additions & 0 deletions features/bicycle/countrybikespeeds.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
@routing @bicycle @countrybikespeeds
Feature: Testbot - Country Profile Selection

# Check that country data is being selected
# CHE (a) does not support trunk on bike
# FIN (c) does not support trunk on bike
# GRC (m) and IRL (o) support bridleway
# LIU (s) is not a country in list so looks like worldwide
# so
# GRC (m) and LIU (s) support trunk

Scenario: Profile Selection - highway chosen for country

Given the extract extra arguments "--location-dependent-data test/data/countrytest.geojson"
And the partition extra arguments "--threads 1"
And the customize extra arguments "--threads 1"

And the profile file "bicycle" initialized with
"""
profile.uselocationtags.countryspeeds = true
"""

And the node locations
| node | lat | lon |
| a | 9.5 | 5.0 |
| b | 9.5 | 10.0 |
| c | 9.5 | 15.0 |
| d | 9.0 | 5.0 |
| e | 9.0 | 10.0 |
| f | 9.0 | 15.0 |
| g | 8.5 | 5.0 |
| h | 8.5 | 10.0 |
| i | 8.5 | 15.0 |
| j | 8.0 | 5.0 |
| k | 8.0 | 10.0 |
| l | 8.0 | 15.0 |
| m | 7.5 | 5.0 |
| n | 7.5 | 10.0 |
| o | 7.5 | 15.0 |
| p | 7.0 | 5.0 |
| q | 7.0 | 10.0 |
| r | 7.0 | 15.0 |
| s | 6.5 | 5.0 |
| t | 6.5 | 10.0 |
| u | 6.5 | 15.0 |

And the ways
| nodes | highway | comment
| ab | trunk | CHE - FIN no
| bc | trunk |
| cf | trunk | FIN - BEL no
| fi | trunk |
| fl | trunk |
| or | trunk | IRL - world yes
| ru | trunk |
| mn | bridleway | GRC - IRL yes
| no | bridleway |
| mp | trunk | GRC - liu yes
| ps | trunk |

And the partition extra arguments "--threads 1"
And the customize extra arguments "--threads 1"


When I route I should get
| waypoints | route | status | message |
| a,b,c | | 400 | Impossible route between points |
| c,l | | 400 | Impossible route between points |
| g,i | | 400 | Impossible route between points |
| o,u | or,ru,ru | 200 | |
| m,o | mn,no,no | 200 | |
| m,s | mp,ps,ps | 200 | |

















39 changes: 39 additions & 0 deletions features/bicycle/countrymotorroad.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@routing @bicycle @countrymotorroad
Feature: Testbot - Country motorroad Selection

# Check that motorroad is avoided

Scenario: bicycle Profile Selection - motorroad avoided

Given the extract extra arguments "--threads 1"
And the partition extra arguments "--threads 1"
And the customize extra arguments "--threads 1"

And the profile file "bicycle" initialized with
"""
profile.uselocationtags.countryspeeds = true
"""

And the node locations
| node | lat | lon |
| a | 9.5 | 5.0 |
| b | 9.5 | 10.0 |
| c | 9.5 | 15.0 |
| d | 9.0 | 5.0 |
| e | 9.0 | 10.0 |
| f | 9.0 | 15.0 |

And the ways
| nodes | highway | motorroad |
| ab | trunk | yes |
| bc | trunk | |
| ad | trunk | |
| de | trunk | |
| ef | trunk | |
| cf | trunk | |

When I route I should get
| waypoints | route | status | message |
| a,c | ad,de,ef,cf,cf | 200 | |
| a,b | ad,de,ef,cf,bc,bc | 200 | |

42 changes: 42 additions & 0 deletions features/bicycle/countryway.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@routing @foot @countryway
Feature: bicycle - Accessability of different way types with countryspeeds

Background:
Given the profile file "bicycle" initialized with
"""
profile.uselocationtags.countryspeeds = true
"""

Scenario: Countrybicycle - Basic access
Then routability should be
| highway | forw |
| motorway | |
| motorway_link | |
| trunk | x |
| trunk_link | x |
| primary | x |
| primary_link | x |
| secondary | x |
| secondary_link | x |
| tertiary | x |
| tertiary_link | x |
| residential | x |
| service | x |
| unclassified | x |
| living_street | x |
| road | x |
| track | x |
| path | x |
| footway | x |
| pedestrian | x |
| steps | x |
| pier | x |
| cycleway | x |
| bridleway | |

Scenario: Country bicycle - Routability of man_made structures
Then routability should be
| highway | man_made | bothw |
| (nil) | (nil) | |
| (nil) | pier | x |

Loading
Loading