Skip to content

Commit

Permalink
fix: account for highways under construction for bikes (#1805)
Browse files Browse the repository at this point in the history
  • Loading branch information
aoles authored Jun 7, 2024
2 parents 73a3f78 + cd30774 commit b38fe4d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 25 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ RELEASING:
### Deprecated
### Removed
### Fixed
- allow bikes on highways under construction if access is explicitly set ([#1805](https://github.com/GIScience/openrouteservice/pull/1805))
### Security

## [8.1.0] - 2024-06-05
Expand Down
4 changes: 2 additions & 2 deletions docs/technical-details/tag-filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Definitions:
_restrictions_ = `[bicycle, vehicle, access]`
_restrictedValues_ = `[private, no, restricted, military, emergency]`
_intendedValues_ = `[yes, designated, official, permissive]`
_wayTypesWithDefaultSpeed_ = `[unclassified, tertiary_link, primary_link, bridleway, tertiary, living_street, trunk, motorway_link, steps, motorway, secondary, path, residential, road, service, footway, pedestrian, track, secondary_link, cycleway, trunk_link, primary]`
_wayTypesWithDefaultSpeed_ = `[unclassified, tertiary_link, primary_link, bridleway, tertiary, living_street, trunk, motorway_link, steps, motorway, secondary, path, residential, road, service, footway, pedestrian, track, secondary_link, cycleway, trunk_link, primary, construction]`

| Tag combination | Reject | Accept | Conditional |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------:|:------------------:|:------------------:|
Expand All @@ -75,7 +75,7 @@ _wayTypesWithDefaultSpeed_ = `[unclassified, tertiary_link, primary_link, bridle
| `sac_scale = hiking` AND `highway = cycleway` | | :heavy_check_mark: | |
| _cycling-regular, cycling-electric:_<br/>`sac_scale != hiking`<br/><br/>_cycling-road:_<br/>`sac_scale = *`<br/><br/>_cycling-mountain:_<br/>`sac_scale != [hiking, mountain_hiking, demanding_mountain_hiking, alpine_hiking]`<br/> | :heavy_check_mark: | | |
| `bicycle = `_intendedValues_ OR `bicycle = dismount` OR `highway = cycleway` OR `bicycle_road = yes` | | :heavy_check_mark: | |
| `highway = [motorway, motorway_link, bridleway]` OR `motorroad = yes` | :heavy_check_mark: | | |
| `highway = [motorway, motorway_link, bridleway, construction]` OR `motorroad = yes` | :heavy_check_mark: | | |
| `highway = ford` OR `ford = *` | | | :heavy_check_mark: |
| _restrictions_ = _restrictedValues_ **if not conditionally permitted** | :heavy_check_mark: | | |
| Default case: Accept **if not conditionally restricted** | | | :heavy_check_mark: |
Expand Down
43 changes: 23 additions & 20 deletions docs/technical-details/travel-speeds/waytype-speeds.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,29 @@ _(all Values in km/h)_

| Waytype \ Profile -> | driving-car | driving-hgv | cycling-regular |
|:--------------------:|:-----------:|:-----------:|:---------------:|
| motorway | 100 | 85 | - |
| motorway_link | 60 | 50 | - |
| motorroad | 90 | 80 | - |
| trunk | 85 | 60 | 18 |
| trunk_link | 60 | 50 | 18 |
| primary | 65 | 60 | 18 |
| primary_link | 50 | 50 | 18 |
| secondary | 60 | 60 | 18 |
| secondary_link | 50 | 50 | 18 |
| tertiary | 50 | 50 | 18 |
| tertiary_link | 40 | 40 | 18 |
| unclassified | 30 | 30 | 16 |
| residential | 30 | 30 | 18 |
| living_street | 10 | 10 | 6 |
| service | 20 | 20 | 14 |
| road | 20 | 20 | 12 |
| track | 15 | 15 | 12 |
| path | - | - | 12 |
| footway | - | - | 6 |
| motorway | 100 | 85 | 18 |
| motorway_link | 60 | 50 | 18 |
| motorroad | 90 | 80 | - |
| trunk | 85 | 60 | 18 |
| trunk_link | 60 | 50 | 18 |
| primary | 65 | 60 | 18 |
| primary_link | 50 | 50 | 18 |
| secondary | 60 | 60 | 18 |
| secondary_link | 50 | 50 | 18 |
| tertiary | 50 | 50 | 18 |
| tertiary_link | 40 | 40 | 18 |
| unclassified | 30 | 30 | 16 |
| residential | 30 | 30 | 18 |
| living_street | 10 | 10 | 6 |
| service | 20 | 20 | 14 |
| road | 20 | 20 | 12 |
| track | 15 | 15 | 12 |
| path | - | - | 10 |
| cycleway | - | - | 18 |
| footway | - | - | 6 |
| pedestrian | - | - | 6 |
| cycleway | - | - | 18 |
| bridleway | - | - | 6 |
| steps | - | - | 2 |
| construction | - | - | 10 |

[svf]: https://github.com/GIScience/openrouteservice/tree/main/ors-engine/src/main/resources/resources/services/routing/speed_limits
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public abstract class CommonBikeFlagEncoder extends BikeCommonFlagEncoder {
public static final String KEY_SEGREGATED = "segregated";
public static final String KEY_ONEWAY_BICYCLE = "oneway:bicycle";
public static final String KEY_BRIDLEWAY = "bridleway";
public static final String KEY_CONSTRUCTION = "construction";

// Pushing section highways are parts where you need to get off your bike and push it (German: Schiebestrecke)
protected final HashSet<String> pushingSectionsHighways = new HashSet<>();
Expand Down Expand Up @@ -231,6 +232,8 @@ protected CommonBikeFlagEncoder(int speedBits, double speedFactor, int maxTurnCo
setHighwaySpeed("unclassified", 16);
// unknown road:
setHighwaySpeed("road", 12);
// sometimes roads allow bicycles during construction
setHighwaySpeed(KEY_CONSTRUCTION, 10);

setHighwaySpeed("trunk", 18);
setHighwaySpeed("trunk_link", 18);
Expand Down Expand Up @@ -352,7 +355,10 @@ public EncodingManager.Access getAccess(ReaderWay way) {
}

// accept only if explicitly tagged for bike usage
if (KEY_MOTORWAY.equals(highwayValue) || KEY_MOTORWAY_LINK.equals(highwayValue) || KEY_BRIDLEWAY.equals(highwayValue)) {
if (KEY_MOTORWAY.equals(highwayValue)
|| KEY_MOTORWAY_LINK.equals(highwayValue)
|| KEY_BRIDLEWAY.equals(highwayValue)
|| KEY_CONSTRUCTION.equals(highwayValue)) {
return EncodingManager.Access.CAN_SKIP;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
"tertiary_link": 18,
"unclassified": 16,
"residential": 18,
"living_street": 12,
"living_street": 6,
"cycleway": 18,
"path": 10,
"service": 14,
"road": 12,
"track": 12,
"footway": 6,
"pedestrian": 6,
"steps": 2
"bridleway": 6,
"steps": 2,
"construction": 10
},
"surface": {
"asphalt": 18,
Expand Down

0 comments on commit b38fe4d

Please sign in to comment.