Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a02a83f8bd | |||
| 9b18f55d29 | |||
| a3434e7ae9 | |||
| 64b15028e4 | |||
| d8e466fdaa | |||
| 43bbe8f2ae |
@@ -1,3 +1,8 @@
|
|||||||
|
# 5.6.1
|
||||||
|
- Changes from 5.6.0
|
||||||
|
- Bugfixes
|
||||||
|
- Fix #3754 restricted access roads not penalized if restriction begins non at an intersection
|
||||||
|
|
||||||
# 5.6.0
|
# 5.6.0
|
||||||
- Changes from 5.5
|
- Changes from 5.5
|
||||||
- Bugfixes
|
- Bugfixes
|
||||||
|
|||||||
@@ -202,8 +202,9 @@ Feature: Car - Restricted access
|
|||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
|
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||||
| primary | designated | designated | | | x | x | 18 | 18 |
|
| primary | designated | designated | | | x | x | 18 | 18 |
|
||||||
| primary | | designated | | | x | x | 18 | 18 |
|
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
|
||||||
| primary | designated | | | | x | x | 18 | 18 |
|
#| primary | | designated | | | x | x | 18 | 18 |
|
||||||
|
#| primary | designated | | | | x | x | 18 | 18 |
|
||||||
| primary | designated\|designated | designated\|designated | | | x | x | 18 | 18 |
|
| primary | designated\|designated | designated\|designated | | | x | x | 18 | 18 |
|
||||||
| primary | designated\|no | designated\|no | | | x | x | 18 | 18 |
|
| primary | designated\|no | designated\|no | | | x | x | 18 | 18 |
|
||||||
| primary | yes\|no | yes\|no | | | x | x | 18 | 18 |
|
| primary | yes\|no | yes\|no | | | x | x | 18 | 18 |
|
||||||
|
|||||||
@@ -81,3 +81,53 @@ Feature: Car - Destination only, no passing through
|
|||||||
| e | a | de,cd,bc,ab,ab |
|
| e | a | de,cd,bc,ab,ab |
|
||||||
| b | d | bc,cd,cd |
|
| b | d | bc,cd,cd |
|
||||||
| d | b | cd,bc,bc |
|
| d | b | cd,bc,bc |
|
||||||
|
|
||||||
|
Scenario: Car - Routing around a way that becomes destination only
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
b
|
||||||
|
\
|
||||||
|
|
|
||||||
|
e++d++++++c--i
|
||||||
|
| \
|
||||||
|
\ h--a
|
||||||
|
\ |
|
||||||
|
\___________g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | access | oneway |
|
||||||
|
| ah | | no |
|
||||||
|
| ihg | | no |
|
||||||
|
| eg | | no |
|
||||||
|
| icde | | no |
|
||||||
|
| cde | destination | no |
|
||||||
|
| eb | | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | # |
|
||||||
|
| i | b | ihg,eg,eb,eb | # goes around access=destination, though restricted way starts at two node intersection |
|
||||||
|
| b | d | eb,cde,cde | # ends in restricted way correctly |
|
||||||
|
| b | i | eb,eg,ihg,ihg | # goes around restricted way correctly |
|
||||||
|
|
||||||
|
Scenario: Car - Routing around a way that becomes destination only
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a---c---b
|
||||||
|
+ \
|
||||||
|
+ |
|
||||||
|
d |
|
||||||
|
\___e
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | access | oneway |
|
||||||
|
| acbe | | no |
|
||||||
|
| cd | destination | no |
|
||||||
|
| de | | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route |
|
||||||
|
| e | a | acbe,acbe |
|
||||||
|
| d | a | de,acbe,acbe |
|
||||||
|
| c | d | cd,cd |
|
||||||
|
|||||||
@@ -28,13 +28,14 @@ module.exports = function () {
|
|||||||
directions.filter(d => headers.has(d + '_rate')).forEach((direction) => {
|
directions.filter(d => headers.has(d + '_rate')).forEach((direction) => {
|
||||||
var rate = direction + '_rate';
|
var rate = direction + '_rate';
|
||||||
var want = row[rate];
|
var want = row[rate];
|
||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case '' === want:
|
case '' === want:
|
||||||
outputRow[rate] = result[direction].status ?
|
outputRow[rate] = result[direction].status ?
|
||||||
result[direction].status.toString() : '';
|
result[direction].status.toString() : '';
|
||||||
break;
|
break;
|
||||||
case /^\d+$/.test(want):
|
case /^\d+$/.test(want):
|
||||||
if (result[direction].rate && !isNaN(result[direction].rate)) {
|
if (result[direction].rate !== undefined && !isNaN(result[direction].rate)) {
|
||||||
outputRow[rate] = result[direction].rate.toString();
|
outputRow[rate] = result[direction].rate.toString();
|
||||||
} else {
|
} else {
|
||||||
outputRow[rate] = '';
|
outputRow[rate] = '';
|
||||||
|
|||||||
+6
-6
@@ -392,11 +392,11 @@ function turn_function (turn)
|
|||||||
else
|
else
|
||||||
turn.weight = turn.duration
|
turn.weight = turn.duration
|
||||||
end
|
end
|
||||||
if properties.weight_name == 'routability' then
|
end
|
||||||
-- penalize turns from non-local access only segments onto local access only tags
|
if properties.weight_name == 'routability' then
|
||||||
if not turn.source_restricted and turn.target_restricted then
|
-- penalize turns from non-local access only segments onto local access only tags
|
||||||
turn.weight = turn.weight + profile.restricted_penalty
|
if not turn.source_restricted and turn.target_restricted then
|
||||||
end
|
turn.weight = turn.weight + profile.restricted_penalty
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user