2015-03-07 19:32:13 -05:00
|
|
|
@match @testbot
|
|
|
|
Feature: Basic Map Matching
|
|
|
|
|
|
|
|
Background:
|
|
|
|
Given the profile "testbot"
|
|
|
|
Given a grid size of 10 meters
|
2016-10-29 11:22:09 -04:00
|
|
|
Given the query options
|
|
|
|
| geometries | geojson |
|
2015-03-07 19:32:13 -05:00
|
|
|
|
2016-03-08 16:02:17 -05:00
|
|
|
Scenario: Testbot - Map matching with outlier that has no candidate
|
2016-11-01 17:13:10 -04:00
|
|
|
Given a grid size of 100 meters
|
2016-03-08 16:02:17 -05:00
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c d
|
2016-11-01 17:13:10 -04:00
|
|
|
|
2016-09-30 03:33:08 -04:00
|
|
|
1
|
|
|
|
"""
|
2016-03-08 16:02:17 -05:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
2022-08-22 15:07:32 -04:00
|
|
|
| trace | timestamps | matchings | data_version |
|
|
|
|
| ab1d | 0 1 2 3 | ad | |
|
|
|
|
|
|
|
|
Scenario: Data_version test on matching
|
|
|
|
Given a grid size of 100 meters
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
|
|
|
|
1
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the extract extra arguments "--data_version cucumber_data_version"
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | matchings | data_version |
|
|
|
|
| ab1d | 0 1 2 3 | ad | cucumber_data_version |
|
2016-03-08 16:02:17 -05:00
|
|
|
|
2015-03-07 19:32:13 -05:00
|
|
|
Scenario: Testbot - Map matching with trace splitting
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
e
|
|
|
|
"""
|
2015-03-07 19:32:13 -05:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | matchings |
|
2015-03-17 19:21:04 -04:00
|
|
|
| abcd | 0 1 62 63 | ab,cd |
|
2015-03-07 19:32:13 -05:00
|
|
|
|
2017-03-20 10:03:43 -04:00
|
|
|
Scenario: Testbot - Map matching with trace splitting suppression
|
|
|
|
Given the query options
|
|
|
|
| gaps | ignore |
|
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
e
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | matchings |
|
|
|
|
| abcd | 0 1 62 63 | abcd |
|
|
|
|
|
|
|
|
Scenario: Testbot - Map matching with trace tidying. Clean case.
|
|
|
|
Given a grid size of 100 meters
|
|
|
|
|
|
|
|
Given the query options
|
2017-03-22 05:00:46 -04:00
|
|
|
| tidy | true |
|
2017-03-20 10:03:43 -04:00
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
e
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | matchings |
|
|
|
|
| abcd | 0 10 20 30 | abcd |
|
|
|
|
|
2017-03-21 09:18:22 -04:00
|
|
|
Scenario: Testbot - Map matching with trace tidying. Dirty case by ts.
|
2017-03-20 10:03:43 -04:00
|
|
|
Given a grid size of 100 meters
|
|
|
|
|
|
|
|
Given the query options
|
2017-03-22 05:00:46 -04:00
|
|
|
| tidy | true |
|
2017-03-20 10:03:43 -04:00
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
e
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | matchings |
|
|
|
|
| abacd | 0 10 12 20 30 | abcd |
|
|
|
|
|
2017-03-21 09:18:22 -04:00
|
|
|
Scenario: Testbot - Map matching with trace tidying. Dirty case by dist.
|
|
|
|
Given a grid size of 8 meters
|
|
|
|
|
|
|
|
Given the query options
|
2017-03-22 05:00:46 -04:00
|
|
|
| tidy | true |
|
2017-03-21 09:18:22 -04:00
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a q b c d
|
|
|
|
e
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| aqbcd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | matchings |
|
|
|
|
| abcbd | abbd |
|
|
|
|
|
2015-03-07 19:32:13 -05:00
|
|
|
Scenario: Testbot - Map matching with small distortion
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c d e
|
|
|
|
f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
h k
|
|
|
|
"""
|
2015-03-07 19:32:13 -05:00
|
|
|
|
|
|
|
# The second way does not need to be a oneway
|
|
|
|
# but the grid spacing triggers the uturn
|
|
|
|
# detection on f
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcde | no |
|
|
|
|
| bfhke | yes |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | matchings |
|
|
|
|
| afcde | abcde |
|
|
|
|
|
|
|
|
Scenario: Testbot - Map matching with oneways
|
2015-09-01 18:42:13 -04:00
|
|
|
Given a grid size of 10 meters
|
2015-03-07 19:32:13 -05:00
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
e f g h
|
|
|
|
"""
|
2015-03-07 19:32:13 -05:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | yes |
|
|
|
|
| hgfe | yes |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | matchings |
|
|
|
|
| dcba | hgfe |
|
|
|
|
|
2016-04-05 07:27:15 -04:00
|
|
|
Scenario: Testbot - Matching with oneway streets
|
|
|
|
Given a grid size of 10 meters
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
e f g h
|
|
|
|
"""
|
2016-04-05 07:27:15 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| ab | yes |
|
|
|
|
| bc | yes |
|
|
|
|
| cd | yes |
|
|
|
|
| hg | yes |
|
|
|
|
| gf | yes |
|
|
|
|
| fe | yes |
|
|
|
|
|
|
|
|
When I match I should get
|
2016-10-29 11:22:09 -04:00
|
|
|
| trace | matchings |
|
|
|
|
| dcba | hgfe |
|
|
|
|
| efgh | abcd |
|
2016-05-09 01:58:13 -04:00
|
|
|
|
2017-01-30 12:56:43 -05:00
|
|
|
Scenario: Testbot - request duration annotations
|
|
|
|
Given the query options
|
|
|
|
| annotations | duration |
|
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d e g h
|
|
|
|
i
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcdegh | no |
|
|
|
|
| ci | no |
|
|
|
|
|
|
|
|
And the speed file
|
|
|
|
"""
|
2017-04-10 10:44:48 -04:00
|
|
|
1,2,36,10
|
2017-01-30 12:56:43 -05:00
|
|
|
"""
|
|
|
|
|
|
|
|
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
2017-03-14 10:39:59 -04:00
|
|
|
And the customize extra arguments "--segment-speed-file {speeds_file}"
|
2017-01-30 12:56:43 -05:00
|
|
|
|
|
|
|
When I match I should get
|
2017-02-02 07:30:01 -05:00
|
|
|
| trace | matchings | a:duration |
|
|
|
|
| ach | ach | 1:1,0:1:1:2:1 |
|
2017-01-30 12:56:43 -05:00
|
|
|
|
2016-05-09 01:58:13 -04:00
|
|
|
Scenario: Testbot - Duration details
|
2016-05-26 15:29:15 -04:00
|
|
|
Given the query options
|
2017-02-02 07:30:01 -05:00
|
|
|
| annotations | duration,nodes |
|
2016-05-26 15:29:15 -04:00
|
|
|
|
2016-05-09 01:58:13 -04:00
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c d e g h
|
|
|
|
i
|
|
|
|
"""
|
2016-05-09 01:58:13 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcdegh | no |
|
|
|
|
| ci | no |
|
|
|
|
|
2016-07-20 08:59:16 -04:00
|
|
|
And the speed file
|
|
|
|
"""
|
2017-04-10 10:44:48 -04:00
|
|
|
1,2,36,10
|
2016-07-20 08:59:16 -04:00
|
|
|
"""
|
|
|
|
|
2016-09-19 17:13:44 -04:00
|
|
|
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
2017-03-14 10:39:59 -04:00
|
|
|
And the customize extra arguments "--segment-speed-file {speeds_file}"
|
2016-07-20 08:59:16 -04:00
|
|
|
|
2016-05-09 01:58:13 -04:00
|
|
|
When I match I should get
|
2017-02-02 07:30:01 -05:00
|
|
|
| trace | matchings | a:duration |
|
|
|
|
| abeh | abeh | 1:0,1:1:1,0:2:1 |
|
|
|
|
| abci | abci | 1:0,1,0:1 |
|
2016-05-19 11:04:00 -04:00
|
|
|
|
|
|
|
# The following is the same as the above, but separated for readability (line length)
|
|
|
|
When I match I should get
|
2017-02-02 07:30:01 -05:00
|
|
|
| trace | matchings | a:nodes |
|
|
|
|
| abeh | abeh | 1:2:3,2:3:4:5,4:5:6:7 |
|
|
|
|
| abci | abci | 1:2:3,2:3,2:3:8 |
|
2016-06-14 18:23:21 -04:00
|
|
|
|
2016-11-01 16:10:51 -04:00
|
|
|
Scenario: Testbot - Regression test for #3037
|
|
|
|
Given the query options
|
|
|
|
| overview | simplified |
|
|
|
|
| geometries | geojson |
|
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a--->---b--->---c
|
|
|
|
| | |
|
|
|
|
| ^ |
|
|
|
|
| | |
|
|
|
|
e--->---f--->---g
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abc | yes |
|
|
|
|
| efg | yes |
|
|
|
|
| ae | yes |
|
|
|
|
| cg | yes |
|
|
|
|
| fb | yes |
|
|
|
|
|
|
|
|
When I match I should get
|
2022-08-19 17:31:40 -04:00
|
|
|
| trace | matchings | geometry |
|
|
|
|
| efbc | efbc | 1,0.999638,1.000359,0.999638,1.000359,1,1.000719,1 |
|
2016-11-01 16:10:51 -04:00
|
|
|
|
2016-11-07 15:11:21 -05:00
|
|
|
Scenario: Testbot - Geometry details using geojson
|
2016-06-14 18:23:21 -04:00
|
|
|
Given the query options
|
|
|
|
| overview | full |
|
2016-10-29 11:22:09 -04:00
|
|
|
| geometries | geojson |
|
2016-06-14 18:23:21 -04:00
|
|
|
|
|
|
|
Given the node map
|
2016-09-30 03:33:08 -04:00
|
|
|
"""
|
|
|
|
a b c
|
|
|
|
d
|
|
|
|
"""
|
2016-06-14 18:23:21 -04:00
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abc | no |
|
|
|
|
| bd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
2017-01-17 11:17:47 -05:00
|
|
|
| trace | matchings | geometry |
|
|
|
|
| abd | abd | 1,1,1.00009,1,1.00009,1,1.00009,0.99991 |
|
2016-11-01 17:13:10 -04:00
|
|
|
|
2016-11-07 15:11:21 -05:00
|
|
|
Scenario: Testbot - Geometry details using polyline
|
|
|
|
Given the query options
|
|
|
|
| overview | full |
|
|
|
|
| geometries | polyline |
|
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c
|
|
|
|
d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abc | no |
|
|
|
|
| bd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | matchings | geometry |
|
|
|
|
| abd | abd | 1,1,1,1.00009,1,1.00009,0.99991,1.00009 |
|
|
|
|
|
|
|
|
Scenario: Testbot - Geometry details using polyline6
|
|
|
|
Given the query options
|
|
|
|
| overview | full |
|
|
|
|
| geometries | polyline6 |
|
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c
|
|
|
|
d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abc | no |
|
|
|
|
| bd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
2017-01-17 11:17:47 -05:00
|
|
|
| trace | matchings | geometry |
|
|
|
|
| abd | abd | 1,1,1,1.00009,1,1.00009,0.99991,1.00009 |
|
2016-11-07 15:11:21 -05:00
|
|
|
|
2017-01-17 05:49:31 -05:00
|
|
|
Scenario: Testbot - Matching alternatives count test
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d e f
|
|
|
|
g h i
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcdef | yes |
|
|
|
|
| dghi | yes |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | matchings | alternatives |
|
2022-08-19 17:31:40 -04:00
|
|
|
| abcdef | abcde | 0,0,0,1,1,1 |
|
2017-01-17 05:49:31 -05:00
|
|
|
|
2017-06-15 10:06:28 -04:00
|
|
|
Scenario: Testbot - Speed greater than speed threshold
|
|
|
|
Given a grid size of 100 meters
|
2016-11-01 17:13:10 -04:00
|
|
|
Given the query options
|
|
|
|
| geometries | geojson |
|
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b ---- x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
y --- c d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abxycd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | matchings |
|
|
|
|
| abcd | 0 1 2 3 | ab,cd |
|
|
|
|
|
2017-06-15 10:06:28 -04:00
|
|
|
Scenario: Testbot - Speed less than speed threshold
|
|
|
|
Given a grid size of 100 meters
|
2016-11-01 17:13:10 -04:00
|
|
|
Given the query options
|
|
|
|
| geometries | geojson |
|
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | matchings |
|
|
|
|
| abcd | 0 1 2 3 | abcd |
|
2016-11-01 16:23:13 -04:00
|
|
|
|
2017-06-15 10:06:28 -04:00
|
|
|
Scenario: Testbot - Huge gap in the coordinates
|
|
|
|
Given a grid size of 100 meters
|
|
|
|
Given the query options
|
|
|
|
| geometries | geojson |
|
|
|
|
| gaps | ignore |
|
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d ---- x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
y ---- z ---- efjk
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcdxyzefjk | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | matchings |
|
|
|
|
| abcdefjk | 0 1 2 3 50 51 52 53 | abcdefjk |
|
|
|
|
|
2016-11-01 16:23:13 -04:00
|
|
|
# Regression test 1 for issue 3176
|
2017-02-02 07:30:01 -05:00
|
|
|
Scenario: Testbot - multiple segments: properly expose OSM IDs
|
2016-11-01 16:23:13 -04:00
|
|
|
Given the query options
|
|
|
|
| annotations | true |
|
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a-1-b--c--d--e--f-2-g
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | id |
|
|
|
|
| a | 1 |
|
|
|
|
| b | 2 |
|
|
|
|
| c | 3 |
|
|
|
|
| d | 4 |
|
|
|
|
| e | 5 |
|
|
|
|
| f | 6 |
|
|
|
|
| g | 7 |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| ab | no |
|
|
|
|
| bc | no |
|
|
|
|
| cd | no |
|
|
|
|
| de | no |
|
|
|
|
| ef | no |
|
|
|
|
| fg | no |
|
|
|
|
|
|
|
|
When I match I should get
|
2017-02-02 07:30:01 -05:00
|
|
|
| trace | a:nodes |
|
|
|
|
| 12 | 1:2:3:4:5:6:7 |
|
|
|
|
| 21 | 7:6:5:4:3:2:1 |
|
2016-11-01 16:23:13 -04:00
|
|
|
|
|
|
|
# Regression test 2 for issue 3176
|
|
|
|
Scenario: Testbot - same edge: properly expose OSM IDs
|
|
|
|
Given the query options
|
|
|
|
| annotations | true |
|
|
|
|
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a-1-b--c--d--e-2-f
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the nodes
|
|
|
|
| node | id |
|
|
|
|
| a | 1 |
|
|
|
|
| b | 2 |
|
|
|
|
| c | 3 |
|
|
|
|
| d | 4 |
|
|
|
|
| e | 5 |
|
|
|
|
| f | 6 |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcdef | no |
|
|
|
|
|
|
|
|
When I match I should get
|
2017-02-02 07:30:01 -05:00
|
|
|
| trace | a:nodes |
|
|
|
|
| 12 | 1:2:3:4:5:6 |
|
|
|
|
| 21 | 6:5:4:3:2:1 |
|
2017-12-07 10:36:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
Scenario: Matching with waypoints param for start/end
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a-----b---c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
e
|
|
|
|
"""
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abc | no |
|
|
|
|
| bde | no |
|
|
|
|
|
|
|
|
Given the query options
|
|
|
|
| waypoints | 0;3 |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | code | matchings | waypoints |
|
|
|
|
| abde | Ok | abde | ae |
|
|
|
|
|
|
|
|
Scenario: Matching with waypoints param that were tidied away
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a - b - c - e
|
|
|
|
|
|
|
|
|
f
|
|
|
|
|
|
|
|
|
g
|
|
|
|
"""
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abce | no |
|
|
|
|
| cfg | no |
|
|
|
|
|
|
|
|
Given the query options
|
|
|
|
| tidy | true |
|
|
|
|
| waypoints | 0;2;5 |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | code | matchings | waypoints |
|
|
|
|
| abccfg | Ok | abcfg | acg |
|
|
|
|
|
|
|
|
Scenario: Testbot - Map matching refuses to use waypoints with trace splitting
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
e
|
|
|
|
"""
|
|
|
|
Given the query options
|
|
|
|
| waypoints | 0;3 |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | code |
|
|
|
|
| abcd | 0 1 62 63 | NoMatch |
|
|
|
|
|
|
|
|
Scenario: Testbot - Map matching invalid waypoints
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
e
|
|
|
|
"""
|
|
|
|
Given the query options
|
|
|
|
| waypoints | 0;4 |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | code |
|
|
|
|
| abcd | InvalidOptions |
|
|
|
|
|
|
|
|
Scenario: Matching fail with waypoints param missing start/end
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a-----b---c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
e
|
|
|
|
"""
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abc | no |
|
|
|
|
| bde | no |
|
|
|
|
|
|
|
|
Given the query options
|
|
|
|
| waypoints | 1;3 |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | code |
|
|
|
|
| abde | InvalidValue |
|
|
|
|
|
|
|
|
Scenario: Testbot - Map matching with outlier that has no candidate and waypoint parameter
|
|
|
|
Given a grid size of 100 meters
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a b c d
|
|
|
|
|
|
|
|
1
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abcd | no |
|
|
|
|
|
|
|
|
Given the query options
|
|
|
|
| waypoints | 0;2;3 |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | code |
|
|
|
|
| ab1d | 0 1 2 3 | NoMatch |
|
2018-01-29 15:35:55 -05:00
|
|
|
|
|
|
|
Scenario: Regression test - avoid collapsing legs of a tidied split trace
|
|
|
|
Given a grid size of 20 meters
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a--b--f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
e--c---d--g
|
|
|
|
"""
|
|
|
|
Given the query options
|
|
|
|
| tidy | true |
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes | oneway |
|
|
|
|
| abf | no |
|
|
|
|
| be | no |
|
|
|
|
| ecdg | no |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | timestamps | matchings | code |
|
|
|
|
| abbecd | 10 11 27 1516914902 1516914913 1516914952 | ab,ecd | Ok |
|
|
|
|
|
2018-02-23 20:42:11 -05:00
|
|
|
Scenario: Regression test - waypoints trimming too much geometry
|
|
|
|
# fixes bug in map matching collapsing that was dropping path geometries
|
|
|
|
# after segments that had 0 distance in internal route results
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
ad
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|e g
|
|
|
|
b--------------c
|
|
|
|
f h
|
|
|
|
"""
|
|
|
|
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
|
|
|
|
Given the query options
|
|
|
|
| waypoints | 0;4 |
|
|
|
|
| overview | full |
|
|
|
|
|
|
|
|
When I match I should get
|
|
|
|
| trace | geometry | code |
|
2022-08-19 17:31:40 -04:00
|
|
|
| defgh | 1,1,1,0.999457,1.000674,0.999457 | Ok |
|
2018-02-23 20:42:11 -05:00
|
|
|
|
|
|
|
@match @testbot
|
|
|
|
Scenario: Regression test - waypoints trimming too much geometry
|
|
|
|
Given the profile "testbot"
|
|
|
|
Given a grid size of 10 meters
|
|
|
|
Given the query options
|
|
|
|
| geometries | geojson |
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
bh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c
|
|
|
|
g\
|
|
|
|
\k
|
|
|
|
\
|
|
|
|
\
|
|
|
|
\
|
|
|
|
j f
|
|
|
|
"""
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| hc |
|
|
|
|
| cf |
|
|
|
|
Given the query options
|
|
|
|
| waypoints | 0;3 |
|
|
|
|
| overview | full |
|
|
|
|
When I match I should get
|
2022-08-19 17:31:40 -04:00
|
|
|
| trace | geometry | code |
|
|
|
|
| bgkj | 1.000135,1,1.000135,0.999638,1.000386,0.999132 | Ok |
|
2018-02-27 07:39:01 -05:00
|
|
|
|
|
|
|
|
|
|
|
@match @testbot
|
2018-02-28 06:19:50 -05:00
|
|
|
# Regression test for issue #4919
|
|
|
|
Scenario: Regression test - non-uturn maneuver preferred over uturn
|
2018-02-27 07:39:01 -05:00
|
|
|
Given the profile "testbot"
|
|
|
|
Given a grid size of 10 meters
|
|
|
|
Given the query options
|
|
|
|
| geometries | geojson |
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
e
|
|
|
|
;
|
|
|
|
;
|
2018-02-28 06:19:50 -05:00
|
|
|
a----hb-----c
|
2018-02-27 07:39:01 -05:00
|
|
|
;
|
|
|
|
;
|
|
|
|
d
|
|
|
|
"""
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| abc |
|
2018-02-28 06:19:50 -05:00
|
|
|
| dbe |
|
2018-02-27 07:39:01 -05:00
|
|
|
Given the query options
|
|
|
|
| waypoints | 0;2 |
|
|
|
|
| overview | full |
|
|
|
|
| steps | true |
|
|
|
|
When I match I should get
|
2022-08-19 17:31:40 -04:00
|
|
|
| trace | geometry | turns | code |
|
|
|
|
| abc | 1,0.999729,1.000269,0.999729,1.000539,0.999729 | depart,arrive | Ok |
|
|
|
|
| abd | 1,0.999729,1.000269,0.999729,1.000269,0.999457 | depart,turn right,arrive | Ok |
|
|
|
|
| abe | 1,0.999729,1.000269,0.999729,1.000269,1 | depart,turn left,arrive | Ok |
|
|
|
|
| ahd | 1,0.999729,1.000269,0.999729,1.000269,0.999457 | depart,turn right,arrive | Ok |
|
|
|
|
| ahe | 1,0.999729,1.000269,0.999729,1.000269,1 | depart,turn left,arrive | Ok |
|
2018-03-13 14:31:29 -04:00
|
|
|
|
|
|
|
@match @testbot
|
|
|
|
Scenario: Regression test - add source phantoms properly (one phantom on one edge)
|
|
|
|
Given the profile "testbot"
|
|
|
|
Given a grid size of 10 meters
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a--1-b2-cd3--e
|
|
|
|
"""
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bcd |
|
|
|
|
| de |
|
|
|
|
Given the query options
|
|
|
|
| geometries | geojson |
|
|
|
|
| overview | full |
|
|
|
|
| steps | true |
|
|
|
|
| waypoints | 0;2 |
|
|
|
|
| annotations | duration,weight |
|
|
|
|
| generate_hints | false |
|
|
|
|
When I match I should get
|
2022-08-19 17:31:40 -04:00
|
|
|
| trace | geometry | a:duration | a:weight | duration |
|
|
|
|
| 123 | 1.000135,1,1.000225,1,1.000359,1,1.000404,1,1.000449,1 | 1:1.5:0.5:0.4 | 1:1.5:0.5:0.4 | 3.4 |
|
|
|
|
| 321 | 1.000449,1,1.000404,1,1.000359,1,1.000225,1,1.000135,1 | 0.4:0.5:1.5:1 | 0.4:0.5:1.5:1 | 3.4 |
|
2018-03-13 14:31:29 -04:00
|
|
|
|
|
|
|
@match @testbot
|
|
|
|
Scenario: Regression test - add source phantom properly (two phantoms on one edge)
|
|
|
|
Given the profile "testbot"
|
|
|
|
Given a grid size of 10 meters
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a--1-b23-c4--d
|
|
|
|
"""
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
| bc |
|
|
|
|
| cd |
|
|
|
|
Given the query options
|
|
|
|
| geometries | geojson |
|
|
|
|
| overview | full |
|
|
|
|
| steps | true |
|
|
|
|
| waypoints | 0;3 |
|
|
|
|
| annotations | duration,weight |
|
|
|
|
| generate_hints | false |
|
|
|
|
When I match I should get
|
2022-08-19 17:31:40 -04:00
|
|
|
| trace | geometry | a:duration | a:weight | duration |
|
|
|
|
| 1234 | 1.000135,1,1.000225,1,1.000404,1,1.000449,1 | 1:2:0.4 | 1:2:0.4 | 3.4 |
|
|
|
|
| 4321 | 1.000449,1,1.000404,1,1.000225,1,1.000135,1 | 0.4:2:1 | 0.4:2:1 | 3.4 |
|
2018-03-13 14:31:29 -04:00
|
|
|
|
|
|
|
@match @testbot
|
|
|
|
Scenario: Regression test - add source phantom properly (two phantoms on one edge)
|
|
|
|
Given the profile "testbot"
|
|
|
|
Given a grid size of 10 meters
|
|
|
|
Given the node map
|
|
|
|
"""
|
|
|
|
a--12345-b
|
|
|
|
"""
|
|
|
|
And the ways
|
|
|
|
| nodes |
|
|
|
|
| ab |
|
|
|
|
Given the query options
|
|
|
|
| geometries | geojson |
|
|
|
|
| overview | full |
|
|
|
|
| steps | true |
|
|
|
|
| waypoints | 0;3 |
|
|
|
|
| annotations | duration,weight,distance |
|
|
|
|
| generate_hints | false |
|
|
|
|
|
|
|
|
# These should have the same weights/duration in either direction
|
|
|
|
When I match I should get
|
2022-10-03 15:43:51 -04:00
|
|
|
| trace | geometry | a:distance | a:duration | a:weight | duration |
|
2023-02-02 12:58:25 -05:00
|
|
|
| 2345 | 1.00018,1,1.000314,1 | 14.91466649 | 1.4 | 1.4 | 1.4 |
|
|
|
|
| 4321 | 1.00027,1,1.000135,1 | 15.02596997 | 1.5 | 1.5 | 1.5 |
|
2022-08-22 15:07:32 -04:00
|
|
|
|