add restricted penalty on NoTurn turns
This commit is contained in:
parent
7632c20ddf
commit
8e43c8cbce
@ -81,3 +81,32 @@ 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
|
||||||
|
f |
|
||||||
|
\________________g
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | access | oneway |
|
||||||
|
| ah | | no |
|
||||||
|
| ihg | | no |
|
||||||
|
| gfe | | no |
|
||||||
|
| icde | | no |
|
||||||
|
| cde | destination | no |
|
||||||
|
| eb | | no |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | # |
|
||||||
|
| i | b | ihg,ihg,gfe,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,gfe,ihg,ihg | # goes around restricted way correctly |
|
||||||
|
@ -393,11 +393,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
|
||||||
|
Loading…
Reference in New Issue
Block a user