remove workaround, reduce memory consumption in lcs computation
This commit is contained in:
parent
74e1d1c27a
commit
fd52c80573
@ -17,27 +17,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | nj | j | only_right_turn @ (has_pygmies > 10 p) |
|
| restriction | bj | aj | j | only_right_turn @ (has_pygmies > 10 p) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,js,js |
|
| b | c | bj,jc,jc |
|
||||||
| e | n | ej,nj,nj |
|
| b | a | bj,aj,aj |
|
||||||
| e | p | ej,jp,jp |
|
| b | d | bj,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Restriction would be on, but the restriction was badly tagged
|
Scenario: Car - Restriction would be on, but the restriction was badly tagged
|
||||||
@ -48,29 +48,29 @@ Feature: Car - Turn restrictions
|
|||||||
|
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p |
|
p |
|
||||||
\ |
|
\ |
|
||||||
j
|
j
|
||||||
| \
|
| \
|
||||||
s m
|
c m
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes |
|
| nodes |
|
||||||
| nj |
|
| aj |
|
||||||
| js |
|
| jc |
|
||||||
| pjm |
|
| pjm |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | nj | pjm | j | no_left_turn @ (Mo-Fr 07:00-10:30) |
|
| restriction | aj | pjm | j | no_left_turn @ (Mo-Fr 07:00-10:30) |
|
||||||
| restriction | js | pjm | j | no_right_turn @ (Mo-Fr 07:00-10:30) |
|
| restriction | jc | pjm | j | no_right_turn @ (Mo-Fr 07:00-10:30) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| n | m | nj,pjm,pjm |
|
| a | m | aj,pjm,pjm |
|
||||||
| s | m | js,pjm,pjm |
|
| c | m | jc,pjm,pjm |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Restriction With Compressed Geometry
|
Scenario: Car - Restriction With Compressed Geometry
|
||||||
@ -149,29 +149,29 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | no |
|
| bj | no |
|
||||||
| jp | no |
|
| jd | no |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional | except |
|
| type | way:from | way:to | node:via | restriction:conditional | except |
|
||||||
| restriction | ej | nj | j | only_right_turn @ (Mo-Su 08:00-12:00) | motorcar |
|
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 08:00-12:00) | motorcar |
|
||||||
| restriction | jp | nj | j | only_left_turn @ (Mo-Su 08:00-12:00) | bus |
|
| restriction | jd | aj | j | only_left_turn @ (Mo-Su 08:00-12:00) | bus |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | # |
|
| from | to | route | # |
|
||||||
| e | s | ej,js,js | |
|
| b | c | bj,jc,jc | |
|
||||||
| e | n | ej,nj,nj | restriction does not apply to cars |
|
| b | a | bj,aj,aj | restriction does not apply to cars |
|
||||||
| e | p | ej,jp,jp | |
|
| b | d | bj,jd,jd | |
|
||||||
| p | s | jp,nj,nj,js,js | restriction excepting busses still applies to cars |
|
| d | c | jd,aj,aj,jc,jc | restriction excepting busses still applies to cars |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - only_right_turn
|
Scenario: Car - only_right_turn
|
||||||
@ -181,27 +181,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | nj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
|
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,nj,nj,js,js |
|
| b | c | bj,aj,aj,jc,jc |
|
||||||
| e | n | ej,nj,nj |
|
| b | a | bj,aj,aj |
|
||||||
| e | p | ej,nj,nj,jp,jp |
|
| b | d | bj,aj,aj,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - No right turn
|
Scenario: Car - No right turn
|
||||||
@ -211,27 +211,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
|
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | # |
|
| from | to | route | # |
|
||||||
| e | s | ej,js,js | normal turn |
|
| b | c | bj,jc,jc | normal turn |
|
||||||
| e | n | ej,js,js,nj,nj | avoids right turn |
|
| b | a | bj,jc,jc,aj,aj | avoids right turn |
|
||||||
| e | p | ej,jp,jp | normal maneuver |
|
| b | d | bj,jd,jd | normal maneuver |
|
||||||
|
|
||||||
@only_turning @conditionals
|
@only_turning @conditionals
|
||||||
Scenario: Car - only_left_turn
|
Scenario: Car - only_left_turn
|
||||||
@ -241,27 +241,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | js | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
|
| restriction | bj | jc | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,js,js |
|
| b | c | bj,jc,jc |
|
||||||
| e | n | ej,js,js,nj,nj |
|
| b | a | bj,jc,jc,aj,aj |
|
||||||
| e | p | ej,js,js,jp,jp |
|
| b | d | bj,jc,jc,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - No left turn
|
Scenario: Car - No left turn
|
||||||
@ -271,27 +271,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | js | j | no_left_turn @ (Mo-Su 00:00-23:59) |
|
| restriction | bj | jc | j | no_left_turn @ (Mo-Su 00:00-23:59) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,nj,nj,js,js |
|
| b | c | bj,aj,aj,jc,jc |
|
||||||
| e | n | ej,nj,nj |
|
| b | a | bj,aj,aj |
|
||||||
| e | p | ej,jp,jp |
|
| b | d | bj,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction is off
|
Scenario: Car - Conditional restriction is off
|
||||||
@ -301,27 +301,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | nj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
|
| restriction | bj | aj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,js,js |
|
| b | c | bj,jc,jc |
|
||||||
| e | n | ej,nj,nj |
|
| b | a | bj,aj,aj |
|
||||||
| e | p | ej,jp,jp |
|
| b | d | bj,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction is on
|
Scenario: Car - Conditional restriction is on
|
||||||
@ -331,27 +331,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
|
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,js,js |
|
| b | c | bj,jc,jc |
|
||||||
| e | n | ej,js,js,nj,nj |
|
| b | a | bj,jc,jc,aj,aj |
|
||||||
| e | p | ej,jp,jp |
|
| b | d | bj,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction with multiple time windows
|
Scenario: Car - Conditional restriction with multiple time windows
|
||||||
@ -362,28 +362,28 @@ Feature: Car - Turn restrictions
|
|||||||
|
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p |
|
p |
|
||||||
\ |
|
\ |
|
||||||
j
|
j
|
||||||
| \
|
| \
|
||||||
s m
|
c m
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| jp | yes |
|
| jp | yes |
|
||||||
| mj | yes |
|
| mj | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | nj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
|
| restriction | aj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| n | p | nj,js,js,jp,jp |
|
| a | p | aj,jc,jc,jp,jp |
|
||||||
| m | p | mj,jp,jp |
|
| m | p | mj,jp,jp |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
@ -394,27 +394,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | nj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
|
| restriction | bj | aj | j | only_right_turn @ (Mo-Su 07:00-14:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,nj,nj,js,js |
|
| b | c | bj,aj,aj,jc,jc |
|
||||||
| e | n | ej,nj,nj |
|
| b | a | bj,aj,aj |
|
||||||
| e | p | ej,nj,nj,jp,jp |
|
| b | d | bj,aj,aj,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - No right turn
|
Scenario: Car - No right turn
|
||||||
@ -424,27 +424,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
|
| restriction | bj | aj | j | no_right_turn @ (Mo-Fr 07:00-13:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | # |
|
| from | to | route | # |
|
||||||
| e | s | ej,js,js | normal turn |
|
| b | c | bj,jc,jc | normal turn |
|
||||||
| e | n | ej,js,js,nj,nj | avoids right turn |
|
| b | a | bj,jc,jc,aj,aj | avoids right turn |
|
||||||
| e | p | ej,jp,jp | normal maneuver |
|
| b | d | bj,jd,jd | normal maneuver |
|
||||||
|
|
||||||
@only_turning @conditionals
|
@only_turning @conditionals
|
||||||
Scenario: Car - only_left_turn
|
Scenario: Car - only_left_turn
|
||||||
@ -454,27 +454,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | js | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
|
| restriction | bj | jc | j | only_left_turn @ (Mo-Fr 07:00-16:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,js,js |
|
| b | c | bj,jc,jc |
|
||||||
| e | n | ej,js,js,nj,nj |
|
| b | a | bj,jc,jc,aj,aj |
|
||||||
| e | p | ej,js,js,jp,jp |
|
| b | d | bj,jc,jc,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - No left turn
|
Scenario: Car - No left turn
|
||||||
@ -484,27 +484,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | js | j | no_left_turn @ (Mo-Su 00:00-23:59) |
|
| restriction | bj | jc | j | no_left_turn @ (Mo-Su 00:00-23:59) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,nj,nj,js,js |
|
| b | c | bj,aj,aj,jc,jc |
|
||||||
| e | n | ej,nj,nj |
|
| b | a | bj,aj,aj |
|
||||||
| e | p | ej,jp,jp |
|
| b | d | bj,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction is off
|
Scenario: Car - Conditional restriction is off
|
||||||
@ -514,27 +514,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | nj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
|
| restriction | bj | aj | j | no_right_turn @ (Mo-Su 16:00-20:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,js,js |
|
| b | c | bj,jc,jc |
|
||||||
| e | n | ej,nj,nj |
|
| b | a | bj,aj,aj |
|
||||||
| e | p | ej,jp,jp |
|
| b | d | bj,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction is on
|
Scenario: Car - Conditional restriction is on
|
||||||
@ -544,27 +544,27 @@ Feature: Car - Turn restrictions
|
|||||||
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
|
Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600"
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| ej | yes |
|
| bj | yes |
|
||||||
| jp | yes |
|
| jd | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | ej | nj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
|
| restriction | jb | aj | j | no_right_turn @ (Mo-Fr 07:00-14:00) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| e | s | ej,js,js |
|
| b | c | bj,jc,jc |
|
||||||
| e | n | ej,js,js,nj,nj |
|
| b | a | bj,jc,jc,aj,aj |
|
||||||
| e | p | ej,jp,jp |
|
| b | d | bj,jd,jd |
|
||||||
|
|
||||||
@no_turning @conditionals
|
@no_turning @conditionals
|
||||||
Scenario: Car - Conditional restriction with multiple time windows
|
Scenario: Car - Conditional restriction with multiple time windows
|
||||||
@ -575,28 +575,28 @@ Feature: Car - Turn restrictions
|
|||||||
|
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
p |
|
p |
|
||||||
\ |
|
\ |
|
||||||
j
|
j
|
||||||
| \
|
| \
|
||||||
s m
|
c m
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| nj | no |
|
| aj | no |
|
||||||
| js | no |
|
| jc | no |
|
||||||
| jp | yes |
|
| jp | yes |
|
||||||
| mj | yes |
|
| mj | yes |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:conditional |
|
| type | way:from | way:to | node:via | restriction:conditional |
|
||||||
| restriction | nj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
|
| restriction | aj | jp | j | no_right_turn @ (Mo-Fr 07:00-11:00,16:00-18:30) |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| n | p | nj,js,js,jp,jp |
|
| a | p | aj,jc,jc,jp,jp |
|
||||||
| m | p | mj,jp,jp |
|
| m | p | mj,jp,jp |
|
||||||
|
|
||||||
@restriction-way
|
@restriction-way
|
||||||
|
@ -11,27 +11,27 @@ Feature: Car - Turn restrictions
|
|||||||
Scenario: Car - No left turn
|
Scenario: Car - No left turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | wj | j | no_left_turn |
|
| restriction | cj | dj | j | no_left_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| c | d | |
|
||||||
| s | n | sj,nj,nj |
|
| c | a | cj,aj,aj |
|
||||||
| s | e | sj,ej,ej |
|
| c | b | cj,bj,bj |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - No straight on
|
Scenario: Car - No straight on
|
||||||
@ -67,253 +67,259 @@ Feature: Car - Turn restrictions
|
|||||||
Scenario: Car - No right turn
|
Scenario: Car - No right turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | ej | j | no_right_turn |
|
| restriction | cj | bj | j | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| c | d | cj,dj,dj |
|
||||||
| s | n | sj,nj,nj |
|
| c | a | cj,aj,aj |
|
||||||
| s | e | |
|
| c | b | |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - No u-turn
|
Scenario: Car - No u-turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | wj | j | no_u_turn |
|
| restriction | cj | dj | j | no_u_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| c | d | |
|
||||||
| s | n | sj,nj,nj |
|
| c | a | cj,aj,aj |
|
||||||
| s | e | sj,ej,ej |
|
| c | b | cj,bj,bj |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - Handle any no_* relation
|
Scenario: Car - Handle any no_* relation
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | wj | j | no_weird_zigzags |
|
| restriction | cj | dj | j | no_weird_zigzags |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| c | d | |
|
||||||
| s | n | sj,nj,nj |
|
| c | a | cj,aj,aj |
|
||||||
| s | e | sj,ej,ej |
|
| c | b | cj,bj,bj |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only left turn
|
Scenario: Car - Only left turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | wj | j | only_left_turn |
|
| restriction | cj | dj | j | only_left_turn |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route |
|
||||||
|
| c | a | |
|
||||||
|
| c | b | |
|
||||||
|
| c | d | cj,dj,dj |
|
||||||
|
|
||||||
Scenario: Car - Only right turn, invalid
|
Scenario: Car - Only right turn, invalid
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e r
|
d j b r
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
| re | -1 |
|
| rb | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | er | j | only_right_on |
|
| restriction | cj | br | j | only_right_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | r | sj,ej,re,re |
|
| c | r | cj,bj,rb,rb |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only right turn
|
Scenario: Car - Only right turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | ej | j | only_right_turn |
|
| restriction | cj | bj | j | only_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| c | d | |
|
||||||
| s | n | |
|
| c | a | |
|
||||||
| s | e | sj,ej,ej |
|
| c | b | cj,bj,bj |
|
||||||
|
|
||||||
@only_turning
|
@only_turning
|
||||||
Scenario: Car - Only straight on
|
Scenario: Car - Only straight on
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | nj | j | only_straight_on |
|
| restriction | cj | aj | j | only_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| c | d | |
|
||||||
| s | n | sj,nj,nj |
|
| c | a | cj,aj,aj |
|
||||||
| s | e | |
|
| c | b | |
|
||||||
|
|
||||||
@no_turning
|
@no_turning
|
||||||
Scenario: Car - Handle any only_* restriction
|
Scenario: Car - Handle any only_* restriction
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | nj | j | only_weird_zigzags |
|
| restriction | cj | aj | j | only_weird_zigzags |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | |
|
| c | d | |
|
||||||
| s | n | sj,nj,nj |
|
| c | a | cj,aj,aj |
|
||||||
| s | e | |
|
| c | b | |
|
||||||
|
|
||||||
@specific
|
@specific
|
||||||
Scenario: Car - :hgv-qualified on a standard turn restriction
|
Scenario: Car - :hgv-qualified on a standard turn restriction
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:hgv |
|
| type | way:from | way:to | node:via | restriction:hgv |
|
||||||
| restriction | sj | nj | j | no_straight_on |
|
| restriction | cj | aj | j | no_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| c | d | cj,dj,dj |
|
||||||
| s | n | sj,nj,nj |
|
| c | a | cj,aj,aj |
|
||||||
| s | e | sj,ej,ej |
|
| c | b | cj,bj,bj |
|
||||||
|
|
||||||
@specific
|
@specific
|
||||||
Scenario: Car - :motorcar-qualified on a standard turn restriction
|
Scenario: Car - :motorcar-qualified on a standard turn restriction
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction:motorcar |
|
| type | way:from | way:to | node:via | restriction:motorcar |
|
||||||
| restriction | sj | nj | j | no_straight_on |
|
| restriction | cj | aj | j | no_straight_on |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| c | d | cj,dj,dj |
|
||||||
| s | n | |
|
| c | a | |
|
||||||
| s | e | sj,ej,ej |
|
| c | b | cj,bj,bj |
|
||||||
|
|
||||||
@except
|
@except
|
||||||
Scenario: Car - Except tag and on no_ restrictions
|
Scenario: Car - Except tag and on no_ restrictions
|
||||||
@ -484,27 +490,27 @@ Feature: Car - Turn restrictions
|
|||||||
Scenario: Car - Ignore unrecognized restriction
|
Scenario: Car - Ignore unrecognized restriction
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
n
|
a
|
||||||
w j e
|
d j b
|
||||||
s
|
c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
And the ways
|
And the ways
|
||||||
| nodes | oneway |
|
| nodes | oneway |
|
||||||
| sj | yes |
|
| cj | yes |
|
||||||
| nj | -1 |
|
| aj | -1 |
|
||||||
| wj | -1 |
|
| dj | -1 |
|
||||||
| ej | -1 |
|
| bj | -1 |
|
||||||
|
|
||||||
And the relations
|
And the relations
|
||||||
| type | way:from | way:to | node:via | restriction |
|
| type | way:from | way:to | node:via | restriction |
|
||||||
| restriction | sj | wj | j | yield |
|
| restriction | cj | dj | j | yield |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route |
|
| from | to | route |
|
||||||
| s | w | sj,wj,wj |
|
| c | d | cj,dj,dj |
|
||||||
| s | n | sj,nj,nj |
|
| c | a | cj,aj,aj |
|
||||||
| s | e | sj,ej,ej |
|
| c | b | cj,bj,bj |
|
||||||
|
|
||||||
@restriction @compression
|
@restriction @compression
|
||||||
Scenario: Restriction On Compressed Geometry
|
Scenario: Restriction On Compressed Geometry
|
||||||
|
@ -32,38 +32,42 @@ inline std::string longest_common_substring(const std::string &lhs, const std::s
|
|||||||
return "";
|
return "";
|
||||||
|
|
||||||
// array for dynamic programming
|
// array for dynamic programming
|
||||||
std::vector<std::vector<std::uint32_t>> dp(lhs.size(),
|
std::vector<std::uint32_t> dp_previous(rhs.size(), 0), dp_current(rhs.size(), 0);
|
||||||
std::vector<std::uint32_t>(rhs.size(), 0));
|
|
||||||
|
|
||||||
// to remember the best location
|
// to remember the best location
|
||||||
std::uint32_t best = 0;
|
std::uint32_t best = 0;
|
||||||
std::uint32_t best_pos = 0;
|
std::uint32_t best_pos = 0;
|
||||||
|
using std::swap;
|
||||||
for (std::uint32_t i = 0; i < lhs.size(); ++i)
|
for (std::uint32_t i = 0; i < lhs.size(); ++i)
|
||||||
{
|
{
|
||||||
for (std::uint32_t j = 0; j < rhs.size(); ++j)
|
for (std::uint32_t j = 0; j < rhs.size(); ++j)
|
||||||
{
|
{
|
||||||
if (lhs[i] == rhs[j])
|
if (lhs[i] == rhs[j])
|
||||||
{
|
{
|
||||||
dp[i][j] = (i == 0 || j == 0) ? 1 : (dp[i - 1][j - 1] + 1);
|
dp_current[j] = (j == 0) ? 1 : (dp_previous[j - 1] + 1);
|
||||||
if (dp[i][j] > best)
|
if (dp_current[j] > best)
|
||||||
{
|
{
|
||||||
best = dp[i][j];
|
best = dp_current[j];
|
||||||
best_pos = i + 1;
|
best_pos = i + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
swap(dp_previous, dp_current);
|
||||||
}
|
}
|
||||||
// the best position marks the end of the string
|
// the best position marks the end of the string
|
||||||
return lhs.substr(best_pos - best, best);
|
return lhs.substr(best_pos - best, best);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO US-ASCII support only, no UTF-8 support
|
||||||
|
// While UTF-8 might work in some cases, we do not guarantee full functionality
|
||||||
inline auto decompose(const std::string &lhs, const std::string &rhs)
|
inline auto decompose(const std::string &lhs, const std::string &rhs)
|
||||||
{
|
{
|
||||||
auto const lcs = longest_common_substring(lhs, rhs);
|
auto const lcs = longest_common_substring(lhs, rhs);
|
||||||
|
|
||||||
// trim spaces, transform to lower
|
// trim spaces, transform to lower
|
||||||
const auto trim = [](auto str) {
|
const auto trim = [](auto str) {
|
||||||
|
// we compare suffixes based on this value, it might break UTF chars, but as long as we are
|
||||||
|
// consistent in handling, we do not create bad results
|
||||||
boost::to_lower(str);
|
boost::to_lower(str);
|
||||||
auto front = str.find_first_not_of(" ");
|
auto front = str.find_first_not_of(" ");
|
||||||
|
|
||||||
@ -136,10 +140,6 @@ inline bool requiresNameAnnounced(const std::string &from_name,
|
|||||||
decompose(first, second);
|
decompose(first, second);
|
||||||
|
|
||||||
const auto checkTable = [&](const std::string &str) {
|
const auto checkTable = [&](const std::string &str) {
|
||||||
// workaround for cucumber tests:
|
|
||||||
if (str.length() == 1 && (first.length() == 2 || second.length() == 2))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return str.empty() || suffix_table.isSuffix(str);
|
return str.empty() || suffix_table.isSuffix(str);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user