mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Update entrances when entrance nodes are updated
This commit is contained in:
22
test/bdd/features/db/import/entrances.feature
Normal file
22
test/bdd/features/db/import/entrances.feature
Normal file
@@ -0,0 +1,22 @@
|
||||
Feature: Entrance nodes are recorded
|
||||
Test that imported entrance nodes are saved
|
||||
|
||||
Scenario: A building with two entrances
|
||||
Given the grid
|
||||
| 1 | 2 |
|
||||
| 4 | 3 |
|
||||
Given the places
|
||||
| osm | class | type | geometry | extratags |
|
||||
| W1 | building | yes | (1,2,3,4,1) | |
|
||||
| N10 | entrance | main | 1 | 'wheelchair': 'yes' |
|
||||
| N20 | entrance | yes | 3 | |
|
||||
And the ways
|
||||
| id | nodes |
|
||||
| 1 | 10,20,30,40 |
|
||||
When importing
|
||||
Then placex contains exactly
|
||||
| object | place_id |
|
||||
| W1 | 1 |
|
||||
Then place_entrance contains exactly
|
||||
| place_id | entrances |
|
||||
| 1 | [{'lat': 0, 'lon': 0, 'type': 'main', 'osm_id': 10, 'extratags': {'wheelchair': 'yes'}}, {'lat': 1e-05, 'lon': 1e-05, 'type': 'yes', 'osm_id': 20, 'extratags': {}}] |
|
||||
82
test/bdd/features/db/update/entrances.feature
Normal file
82
test/bdd/features/db/update/entrances.feature
Normal file
@@ -0,0 +1,82 @@
|
||||
Feature: Entrance nodes are recorded
|
||||
Test that updated entrance nodes are saved
|
||||
|
||||
Scenario: A building with a newly tagged entrance
|
||||
Given the grid
|
||||
| 1 | 2 |
|
||||
| 4 | 3 |
|
||||
Given the places
|
||||
| osm | class | type | geometry |
|
||||
| W1 | building | yes | (1,2,3,4,1) |
|
||||
And the ways
|
||||
| id | nodes |
|
||||
| 1 | 10,20,30,40 |
|
||||
When importing
|
||||
Then placex contains exactly
|
||||
| object | place_id |
|
||||
| W1 | 1 |
|
||||
Then place_entrance contains exactly
|
||||
| place_id | entrances |
|
||||
When updating places
|
||||
| osm | class | type | geometry |
|
||||
| N10 | entrance | main | 1 |
|
||||
Then placex contains exactly
|
||||
| object | place_id |
|
||||
| W1 | 1 |
|
||||
And place_entrance contains exactly
|
||||
| place_id | entrances |
|
||||
| 1 | [{'lat': 0, 'lon': 0, 'type': 'main', 'osm_id': 10, 'extratags': None}] |
|
||||
|
||||
Scenario: A building with a updated entrance node
|
||||
Given the grid
|
||||
| 1 | 2 |
|
||||
| 4 | 3 |
|
||||
Given the places
|
||||
| osm | class | type | geometry |
|
||||
| W1 | building | yes | (1,2,3,4,1) |
|
||||
| N10 | barrier | gate | 1 |
|
||||
And the ways
|
||||
| id | nodes |
|
||||
| 1 | 10,20,30,40 |
|
||||
When importing
|
||||
Then placex contains exactly
|
||||
| object | place_id |
|
||||
| W1 | 1 |
|
||||
| N10 | 2 |
|
||||
Then place_entrance contains exactly
|
||||
| place_id | entrances |
|
||||
When updating places
|
||||
| osm | class | type | geometry |
|
||||
| N10 | entrance | main | 1 |
|
||||
Then placex contains exactly
|
||||
| object | place_id |
|
||||
| W1 | 1 |
|
||||
| N10 | 2 |
|
||||
And place_entrance contains exactly
|
||||
| place_id | entrances |
|
||||
| 1 | [{'lat': 0, 'lon': 0, 'type': 'main', 'osm_id': 10, 'extratags': None}] |
|
||||
|
||||
Scenario: A building with a removed entrance
|
||||
Given the grid
|
||||
| 1 | 2 |
|
||||
| 4 | 3 |
|
||||
Given the places
|
||||
| osm | class | type | geometry |
|
||||
| W1 | building | yes | (1,2,3,4,1) |
|
||||
| N10 | entrance | main | 1 |
|
||||
And the ways
|
||||
| id | nodes |
|
||||
| 1 | 10,20,30,40 |
|
||||
When importing
|
||||
Then placex contains exactly
|
||||
| object | place_id |
|
||||
| W1 | 1 |
|
||||
And place_entrance contains exactly
|
||||
| place_id | entrances |
|
||||
| 1 | [{'lat': 0, 'lon': 0, 'type': 'main', 'osm_id': 10, 'extratags': None}] |
|
||||
When marking for delete N10
|
||||
Then placex contains exactly
|
||||
| object | place_id |
|
||||
| W1 | 1 |
|
||||
And place_entrance contains exactly
|
||||
| place_id | entrances |
|
||||
Reference in New Issue
Block a user