Feature: Country handling
Tests for update of country information
+ Background:
+ Given the 1.0 grid with origin DE
+ | 1 | | 2 |
+ | | 10 | |
+ | 4 | | 3 |
+
@fail-legacy
Scenario: When country names are changed old ones are no longer searchable
Given the places
- | osm | class | type | admin | name+name:xy | country | geometry |
- | R1 | boundary | administrative | 2 | Loudou | de | (9 52, 9 53, 10 52, 9 52) |
+ | osm | class | type | admin | name+name:xy | country | geometry |
+ | R1 | boundary | administrative | 2 | Loudou | de | (1,2,3,4,1) |
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | town | Wenig | country:de |
+ | osm | class | type | name |
+ | N10 | place | town | Wenig |
When importing
When sending search query "Wenig, Loudou"
Then results contain
| osm |
- | N1 |
+ | N10 |
When updating places
- | osm | class | type | admin | name+name:xy | country | geometry |
- | R1 | boundary | administrative | 2 | Germany | de | (9 52, 9 53, 10 52, 9 52) |
+ | osm | class | type | admin | name+name:xy | country | geometry |
+ | R1 | boundary | administrative | 2 | Germany | de | (1,2,3,4,1) |
When sending search query "Wenig, Loudou"
Then exactly 0 results are returned
@fail-legacy
Scenario: When country names are deleted they are no longer searchable
Given the places
- | osm | class | type | admin | name+name:xy | country | geometry |
- | R1 | boundary | administrative | 2 | Loudou | de | (9 52, 9 53, 10 52, 9 52) |
+ | osm | class | type | admin | name+name:xy | country | geometry |
+ | R1 | boundary | administrative | 2 | Loudou | de | (1,2,3,4,1) |
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | town | Wenig | country:de |
+ | osm | class | type | name |
+ | N10 | place | town | Wenig |
When importing
When sending search query "Wenig, Loudou"
Then results contain
| osm |
- | N1 |
+ | N10 |
When updating places
- | osm | class | type | admin | name+name:en | country | geometry |
- | R1 | boundary | administrative | 2 | Germany | de | (9 52, 9 53, 10 52, 9 52) |
+ | osm | class | type | admin | name+name:en | country | geometry |
+ | R1 | boundary | administrative | 2 | Germany | de | (1,2,3,4,1) |
When sending search query "Wenig, Loudou"
Then exactly 0 results are returned
When sending search query "Wenig"
| xy,en |
Then results contain
| osm | display_name |
- | N1 | Wenig, Germany |
+ | N10 | Wenig, Germany |
Scenario: Default country names are always searchable
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | town | Wenig | country:de |
+ | osm | class | type | name |
+ | N10 | place | town | Wenig |
When importing
When sending search query "Wenig, Germany"
Then results contain
| osm |
- | N1 |
+ | N10 |
When sending search query "Wenig, de"
Then results contain
| osm |
- | N1 |
+ | N10 |
When updating places
| osm | class | type | admin | name+name:en | country | geometry |
- | R1 | boundary | administrative | 2 | Lilly | de | (9 52, 9 53, 10 52, 9 52) |
+ | R1 | boundary | administrative | 2 | Lilly | de | (1,2,3,4,1) |
When sending search query "Wenig, Germany"
| accept-language |
| en,de |
Then results contain
| osm | display_name |
- | N1 | Wenig, Lilly |
+ | N10 | Wenig, Lilly |
When sending search query "Wenig, de"
| accept-language |
| en,de |
Then results contain
| osm | display_name |
- | N1 | Wenig, Lilly |
+ | N10 | Wenig, Lilly |
@fail-legacy
Scenario: When a localised name is deleted, the standard name takes over
Given the places
- | osm | class | type | admin | name+name:de | country | geometry |
- | R1 | boundary | administrative | 2 | Loudou | de | (9 52, 9 53, 10 52, 9 52) |
+ | osm | class | type | admin | name+name:de | country | geometry |
+ | R1 | boundary | administrative | 2 | Loudou | de | (1,2,3,4,1) |
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | town | Wenig | country:de |
+ | osm | class | type | name |
+ | N10 | place | town | Wenig |
When importing
When sending search query "Wenig, Loudou"
| accept-language |
| de,en |
Then results contain
| osm | display_name |
- | N1 | Wenig, Loudou |
+ | N10 | Wenig, Loudou |
When updating places
- | osm | class | type | admin | name+name:en | country | geometry |
- | R1 | boundary | administrative | 2 | Germany | de | (9 52, 9 53, 10 52, 9 52) |
+ | osm | class | type | admin | name+name:en | country | geometry |
+ | R1 | boundary | administrative | 2 | Germany | de | (1,2,3,4,1) |
When sending search query "Wenig, Loudou"
Then exactly 0 results are returned
When sending search query "Wenig"
| de,en |
Then results contain
| osm | display_name |
- | N1 | Wenig, Deutschland |
+ | N10 | Wenig, Deutschland |
Test the interpolated address are updated correctly
Scenario: new interpolation added to existing street
- Given the scene parallel-road
+ Given the grid
+ | 10 | | | | 11 |
+ | | 1 | 99 | 2 | |
+ | | | | | |
+ | 20 | | | | 21 |
And the places
| osm | class | type | name | geometry |
- | W2 | highway | unclassified | Sun Way | :w-north |
- | W3 | highway | unclassified | Cloud Street | :w-south |
+ | W2 | highway | unclassified | Sun Way | 10,11 |
+ | W3 | highway | unclassified | Cloud Street | 20,21 |
And the ways
| id | nodes |
- | 10 | 1,100,101,102,2 |
+ | 10 | 1,2 |
When importing
Then W10 expands to no interpolation
When updating places
- | osm | class | type | housenr | geometry |
- | N1 | place | house | 2 | :n-middle-w |
- | N2 | place | house | 6 | :n-middle-e |
+ | osm | class | type | housenr |
+ | N1 | place | house | 2 |
+ | N2 | place | house | 6 |
And updating places
| osm | class | type | addr+interpolation | geometry |
- | W10 | place | houses | even | :w-middle |
+ | W10 | place | houses | even | 1,2 |
Then placex contains
| object | parent_place_id |
| N1 | W2 |
| N2 | W2 |
And W10 expands to interpolation
- | parent_place_id | start | end |
- | W2 | 4 | 4 |
+ | parent_place_id | start | end | geometry |
+ | W2 | 4 | 4 | 99 |
Scenario: addr:street added to interpolation
- Given the scene parallel-road
+ Given the grid
+ | 10 | | | | 11 |
+ | | 1 | | 2 | |
+ | | | | | |
+ | 20 | | | | 21 |
And the places
- | osm | class | type | housenr | geometry |
- | N1 | place | house | 2 | :n-middle-w |
- | N2 | place | house | 6 | :n-middle-e |
+ | osm | class | type | housenr |
+ | N1 | place | house | 2 |
+ | N2 | place | house | 6 |
And the places
| osm | class | type | addr+interpolation | geometry |
- | W10 | place | houses | even | :w-middle |
+ | W10 | place | houses | even | 1,2 |
And the places
| osm | class | type | name | geometry |
- | W2 | highway | unclassified | Sun Way | :w-north |
- | W3 | highway | unclassified | Cloud Street | :w-south |
+ | W2 | highway | unclassified | Sun Way | 10,11 |
+ | W3 | highway | unclassified | Cloud Street | 20,21 |
And the ways
| id | nodes |
- | 10 | 1,100,101,102,2 |
+ | 10 | 1,2 |
When importing
Then placex contains
| object | parent_place_id |
| W2 | 4 | 4 |
When updating places
| osm | class | type | addr+interpolation | street | geometry |
- | W10 | place | houses | even | Cloud Street | :w-middle |
+ | W10 | place | houses | even | Cloud Street | 1,2 |
Then placex contains
| object | parent_place_id |
| N1 | W3 |
| W3 | 4 | 4 |
Scenario: addr:street added to housenumbers
- Given the scene parallel-road
+ Given the grid
+ | 10 | | | | 11 |
+ | | 1 | | 2 | |
+ | | | | | |
+ | 20 | | | | 21 |
And the places
- | osm | class | type | housenr | geometry |
- | N1 | place | house | 2 | :n-middle-w |
- | N2 | place | house | 6 | :n-middle-e |
+ | osm | class | type | housenr |
+ | N1 | place | house | 2 |
+ | N2 | place | house | 6 |
And the places
| osm | class | type | addr+interpolation | geometry |
- | W10 | place | houses | even | :w-middle |
+ | W10 | place | houses | even | 1,2 |
And the places
| osm | class | type | name | geometry |
- | W2 | highway | unclassified | Sun Way | :w-north |
- | W3 | highway | unclassified | Cloud Street | :w-south |
+ | W2 | highway | unclassified | Sun Way | 10,11 |
+ | W3 | highway | unclassified | Cloud Street | 20,21 |
And the ways
| id | nodes |
- | 10 | 1,100,101,102,2 |
+ | 10 | 1,2 |
When importing
Then placex contains
| object | parent_place_id |
| parent_place_id | start | end |
| W2 | 4 | 4 |
When updating places
- | osm | class | type | street | housenr | geometry |
- | N1 | place | house | Cloud Street| 2 | :n-middle-w |
- | N2 | place | house | Cloud Street| 6 | :n-middle-e |
+ | osm | class | type | street | housenr |
+ | N1 | place | house | Cloud Street| 2 |
+ | N2 | place | house | Cloud Street| 6 |
Then placex contains
| object | parent_place_id |
| N1 | W3 |
| W3 | 4 | 4 |
Scenario: interpolation tag removed
- Given the scene parallel-road
+ Given the grid
+ | 10 | | | | 11 |
+ | | 1 | | 2 | |
+ | | | | | |
+ | 20 | | | | 21 |
And the places
- | osm | class | type | housenr | geometry |
- | N1 | place | house | 2 | :n-middle-w |
- | N2 | place | house | 6 | :n-middle-e |
+ | osm | class | type | housenr |
+ | N1 | place | house | 2 |
+ | N2 | place | house | 6 |
And the places
| osm | class | type | addr+interpolation | geometry |
- | W10 | place | houses | even | :w-middle |
+ | W10 | place | houses | even | 1,2 |
And the places
| osm | class | type | name | geometry |
- | W2 | highway | unclassified | Sun Way | :w-north |
- | W3 | highway | unclassified | Cloud Street | :w-south |
+ | W2 | highway | unclassified | Sun Way | 10,11 |
+ | W3 | highway | unclassified | Cloud Street | 20,21 |
And the ways
| id | nodes |
- | 10 | 1,100,101,102,2 |
+ | 10 | 1,2 |
When importing
Then placex contains
| object | parent_place_id |
| N2 | W2 |
Scenario: referenced road added
- Given the scene parallel-road
+ Given the grid
+ | 10 | | | | 11 |
+ | | 1 | | 2 | |
+ | | | | | |
+ | 20 | | | | 21 |
And the places
- | osm | class | type | housenr | geometry |
- | N1 | place | house | 2 | :n-middle-w |
- | N2 | place | house | 6 | :n-middle-e |
+ | osm | class | type | housenr |
+ | N1 | place | house | 2 |
+ | N2 | place | house | 6 |
And the places
| osm | class | type | addr+interpolation | street | geometry |
- | W10 | place | houses | even | Cloud Street| :w-middle |
+ | W10 | place | houses | even | Cloud Street| 1,2 |
And the places
| osm | class | type | name | geometry |
- | W2 | highway | unclassified | Sun Way | :w-north |
+ | W2 | highway | unclassified | Sun Way | 10,11 |
And the ways
| id | nodes |
- | 10 | 1,100,101,102,2 |
+ | 10 | 1,2 |
When importing
Then placex contains
| object | parent_place_id |
| W2 | 4 | 4 |
When updating places
| osm | class | type | name | geometry |
- | W3 | highway | unclassified | Cloud Street | :w-south |
+ | W3 | highway | unclassified | Cloud Street | 20,21 |
Then placex contains
| object | parent_place_id |
| N1 | W3 |
| W3 | 4 | 4 |
Scenario: referenced road deleted
- Given the scene parallel-road
+ Given the grid
+ | 10 | | | | 11 |
+ | | 1 | | 2 | |
+ | | | | | |
+ | 20 | | | | 21 |
And the places
- | osm | class | type | housenr | geometry |
- | N1 | place | house | 2 | :n-middle-w |
- | N2 | place | house | 6 | :n-middle-e |
+ | osm | class | type | housenr |
+ | N1 | place | house | 2 |
+ | N2 | place | house | 6 |
And the places
| osm | class | type | addr+interpolation | street | geometry |
- | W10 | place | houses | even | Cloud Street| :w-middle |
+ | W10 | place | houses | even | Cloud Street| 1,2 |
And the places
| osm | class | type | name | geometry |
- | W2 | highway | unclassified | Sun Way | :w-north |
- | W3 | highway | unclassified | Cloud Street | :w-south |
+ | W2 | highway | unclassified | Sun Way | 10,11 |
+ | W3 | highway | unclassified | Cloud Street | 20,21 |
And the ways
| id | nodes |
- | 10 | 1,100,101,102,2 |
+ | 10 | 1,2 |
When importing
Then placex contains
| object | parent_place_id |
| W2 | 4 | 4 |
Scenario: building becomes interpolation
- Given the scene building-with-parallel-streets
+ Given the grid
+ | 10 | | | | 11 |
+ | | 1 | | 2 | |
+ | | 4 | | 3 | |
And the places
- | osm | class | type | housenr | geometry |
- | W1 | place | house | 3 | :w-building |
+ | osm | class | type | housenr | geometry |
+ | W1 | place | house | 3 | (1,2,3,4,1) |
And the places
| osm | class | type | name | geometry |
- | W2 | highway | unclassified | Cloud Street | :w-south |
+ | W2 | highway | unclassified | Cloud Street | 10,11 |
When importing
Then placex contains
| object | parent_place_id |
| W1 | W2 |
Given the ways
| id | nodes |
- | 1 | 1,100,101,102,2 |
+ | 1 | 1,2 |
When updating places
- | osm | class | type | housenr | geometry |
- | N1 | place | house | 2 | :n-north-w |
- | N2 | place | house | 6 | :n-north-e |
+ | osm | class | type | housenr |
+ | N1 | place | house | 2 |
+ | N2 | place | house | 6 |
And updating places
| osm | class | type | addr+interpolation | street | geometry |
- | W1 | place | houses | even | Cloud Street| :w-north |
+ | W1 | place | houses | even | Cloud Street| 1,2 |
Then placex has no entry for W1
And W1 expands to interpolation
| parent_place_id | start | end |
| W2 | 4 | 4 |
Scenario: interpolation becomes building
- Given the scene building-with-parallel-streets
+ Given the grid
+ | 10 | | | | 11 |
+ | | 1 | | 2 | |
+ | | 4 | | 3 | |
And the places
- | osm | class | type | housenr | geometry |
- | N1 | place | house | 2 | :n-north-w |
- | N2 | place | house | 6 | :n-north-e |
+ | osm | class | type | housenr |
+ | N1 | place | house | 2 |
+ | N2 | place | house | 6 |
And the places
| osm | class | type | name | geometry |
- | W2 | highway | unclassified | Cloud Street | :w-south |
+ | W2 | highway | unclassified | Cloud Street | 10,11 |
And the ways
| id | nodes |
- | 1 | 1,100,101,102,2 |
+ | 1 | 1,2 |
And the places
| osm | class | type | addr+interpolation | street | geometry |
- | W1 | place | houses | even | Cloud Street| :w-north |
+ | W1 | place | houses | even | Cloud Street| 1,2 |
When importing
Then placex has no entry for W1
And W1 expands to interpolation
| parent_place_id | start | end |
| W2 | 4 | 4 |
When updating places
- | osm | class | type | housenr | geometry |
- | W1 | place | house | 3 | :w-building |
+ | osm | class | type | housenr | geometry |
+ | W1 | place | house | 3 | (1,2,3,4,1) |
Then placex contains
| object | parent_place_id |
| W1 | W2 |
+ And W1 expands to no interpolation
Scenario: housenumbers added to interpolation
- Given the scene building-with-parallel-streets
+ Given the grid
+ | 10 | | | | 11 |
+ | | 1 | | 2 | |
And the places
| osm | class | type | name | geometry |
- | W2 | highway | unclassified | Cloud Street | :w-south |
+ | W2 | highway | unclassified | Cloud Street | 10,11 |
And the ways
| id | nodes |
- | 1 | 1,100,101,102,2 |
+ | 1 | 1,2 |
And the places
| osm | class | type | addr+interpolation | geometry |
- | W1 | place | houses | even | :w-north |
+ | W1 | place | houses | even | 1,2 |
When importing
Then W1 expands to no interpolation
When updating places
- | osm | class | type | housenr | geometry |
- | N1 | place | house | 2 | :n-north-w |
- | N2 | place | house | 6 | :n-north-e |
- And updating places
- | osm | class | type | addr+interpolation | street | geometry |
- | W1 | place | houses | even | Cloud Street| :w-north |
+ | osm | class | type | housenr |
+ | N1 | place | house | 2 |
+ | N2 | place | house | 6 |
Then W1 expands to interpolation
| parent_place_id | start | end |
| W2 | 4 | 4 |
Tests that linked places are correctly added and deleted.
Scenario: Linking is kept when boundary is updated
+ Given the 0.1 grid
+ | 10 | | 11 |
+ | | 1 | |
+ | 13 | | 12 |
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | city | foo | 0 0 |
+ | osm | class | type | name |
+ | N1 | place | city | foo |
And the places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | foo | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
When importing
Then placex contains
| object | linked_place_id |
| N1 | R1 |
When updating places
| osm | class | type | name | name+name:de | admin | geometry |
- | R1 | boundary | administrative | foo | Dingens | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | foo | Dingens | 8 | (10,11,12,13,10) |
Then placex contains
| object | linked_place_id |
| N1 | R1 |
Scenario: Add linked place when linking relation is renamed
+ Given the 0.1 grid
+ | 10 | | 11 |
+ | | 1 | |
+ | 13 | | 12 |
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | city | foo | 0 0 |
+ | osm | class | type | name |
+ | N1 | place | city | foo |
And the places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | foo | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
When importing
- And sending search query "foo"
+ Then placex contains
+ | object | linked_place_id |
+ | N1 | R1 |
+ When sending search query "foo"
| dups |
| 1 |
Then results contain
| R |
When updating places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | foobar | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | foobar | 8 | (10,11,12,13,10) |
Then placex contains
| object | linked_place_id |
| N1 | - |
| N |
Scenario: Add linked place when linking relation is removed
+ Given the 0.1 grid
+ | 10 | | 11 |
+ | | 1 | |
+ | 13 | | 12 |
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | city | foo | 0 0 |
+ | osm | class | type | name |
+ | N1 | place | city | foo |
And the places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | foo | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
When importing
And sending search query "foo"
| dups |
| N |
Scenario: Remove linked place when linking relation is added
+ Given the 0.1 grid
+ | 10 | | 11 |
+ | | 1 | |
+ | 13 | | 12 |
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | city | foo | 0 0 |
+ | osm | class | type | name |
+ | N1 | place | city | foo |
When importing
And sending search query "foo"
| dups |
| N |
When updating places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | foo | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
Then placex contains
| object | linked_place_id |
| N1 | R1 |
| R |
Scenario: Remove linked place when linking relation is renamed
+ Given the 0.1 grid
+ | 10 | | 11 |
+ | | 1 | |
+ | 13 | | 12 |
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | city | foo | 0 0 |
+ | osm | class | type | name |
+ | N1 | place | city | foo |
And the places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | foobar | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | foobar | 8 | (10,11,12,13,10) |
When importing
And sending search query "foo"
| dups |
| N |
When updating places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | foo | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
Then placex contains
| object | linked_place_id |
| N1 | R1 |
| R |
Scenario: Update linking relation when linkee name is updated
+ Given the 0.1 grid
+ | 10 | | 11 |
+ | | 3 | |
+ | 13 | | 12 |
Given the places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | rel | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | rel | 8 | (10,11,12,13,10) |
And the places
- | osm | class | type | name+name:de | admin | geometry |
- | N3 | place | city | pnt | 30 | 0.00001 0 |
+ | osm | class | type | name+name:de |
+ | N3 | place | city | pnt |
And the relations
| id | members |
| 1 | N3:label |
| object | linked_place_id | name+name:de |
| N3 | R1 | pnt |
When updating places
- | osm | class | type | name+name:de | admin | geometry |
- | N3 | place | city | newname | 30 | 0.00001 0 |
+ | osm | class | type | name+name:de |
+ | N3 | place | city | newname |
Then placex contains
| object | linked_place_id | name+name:de |
| N3 | R1 | newname |
| R1 | - | newname |
Scenario: Update linking relation when linkee name is deleted
+ Given the 0.1 grid
+ | 10 | | 11 |
+ | | 3 | |
+ | 13 | | 12 |
Given the places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | rel | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | rel | 8 | (10,11,12,13,10) |
And the places
- | osm | class | type | name | admin | geometry |
- | N3 | place | city | pnt | 30 | 0.00001 0 |
+ | osm | class | type | name |
+ | N3 | place | city | pnt |
And the relations
| id | members |
| 1 | N3:label |
| osm |
| R1 |
When updating places
- | osm | class | type | name+name:de | admin | geometry |
- | N3 | place | city | depnt | 30 | 0.00001 0 |
+ | osm | class | type | name+name:de |
+ | N3 | place | city | depnt |
Then placex contains
| object | linked_place_id | name+name:de |
| N3 | R1 | depnt |
Then exactly 0 results are returned
Scenario: Updating linkee extratags keeps linker's extratags
+ Given the 0.1 grid
+ | 10 | | 11 |
+ | | 3 | |
+ | 13 | | 12 |
Given the named places
| osm | class | type | extra+wikidata | admin | geometry |
- | R1 | boundary | administrative | 34 | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | 34 | 8 | (10,11,12,13,10) |
And the named places
- | osm | class | type | geometry |
- | N3 | place | city | 0.00001 0 |
+ | osm | class | type |
+ | N3 | place | city |
And the relations
| id | members |
| 1 | N3:label |
| object | extratags |
| R1 | 'wikidata' : '34', 'linked_place' : 'city' |
When updating places
- | osm | class | type | name | extra+oneway | admin | geometry |
- | N3 | place | city | newname | yes | 30 | 0.00001 0 |
+ | osm | class | type | name | extra+oneway |
+ | N3 | place | city | newname | yes |
Then placex contains
| object | extratags |
| R1 | 'wikidata' : '34', 'oneway' : 'yes', 'linked_place' : 'city' |
Scenario: Remove linked_place info when linkee is removed
+ Given the 0.1 grid
+ | 10 | | 11 |
+ | | 1 | |
+ | 13 | | 12 |
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | city | foo | 0 0 |
+ | osm | class | type | name |
+ | N1 | place | city | foo |
And the places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | foo | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
When importing
Then placex contains
| object | extratags |
| R1 | |
Scenario: Update linked_place info when linkee type changes
+ Given the 0.1 grid
+ | 10 | | 11 |
+ | | 1 | |
+ | 13 | | 12 |
Given the places
- | osm | class | type | name | geometry |
- | N1 | place | city | foo | 0 0 |
+ | osm | class | type | name |
+ | N1 | place | city | foo |
And the places
| osm | class | type | name | admin | geometry |
- | R1 | boundary | administrative | foo | 8 | poly-area:0.1 |
+ | R1 | boundary | administrative | foo | 8 | (10,11,12,13,10) |
When importing
Then placex contains
| object | extratags |
| R1 | 'linked_place' : 'city' |
When updating places
- | osm | class | type | name | geometry |
- | N1 | place | town | foo | 0 0 |
+ | osm | class | type | name |
+ | N1 | place | town | foo |
Then placex contains
| object | extratags |
| R1 | 'linked_place' : 'town' |
Test all naming related issues in updates
Scenario: Delete postcode from postcode boundaries without ref
+ Given the grid with origin DE
+ | 1 | 2 |
+ | 4 | 3 |
Given the places
| osm | class | type | postcode | geometry |
- | R1 | boundary | postal_code | 12345 | poly-area:0.5 |
+ | R1 | boundary | postal_code | 12345 | (1,2,3,4,1) |
When importing
And sending search query "12345"
Then results contain
| 0 | R1 |
When updating places
| osm | class | type | geometry |
- | R1 | boundary | postal_code | poly-area:0.5 |
+ | R1 | boundary | postal_code | (1,2,3,4,1) |
Then placex has no entry for R1
Feature: Update parenting of objects
Scenario: POI inside building inherits addr:street change
- Given the scene building-on-street-corner
+ Given the grid
+ | 10 | | | | | | | 11 |
+ | | | 5 | | | 6 | | |
+ | | | | | | | | |
+ | | | | | 1 | | | |
+ | 12 | | 8 | | | 7 | | |
And the named places
- | osm | class | type | geometry |
- | N1 | amenity | bank | :n-inner |
- | N2 | shop | bakery | :n-edge-NS |
- | N3 | shop | supermarket| :n-edge-WE |
+ | osm | class | type |
+ | N1 | amenity | bank |
And the places
| osm | class | type | street | housenr | geometry |
- | W1 | building | yes | nowhere | 3 | :w-building |
+ | W1 | building | yes | nowhere | 3 | (5,6,7,8,5) |
And the places
| osm | class | type | name | geometry |
- | W2 | highway | primary | bar | :w-WE |
- | W3 | highway | residential | foo | :w-NS |
+ | W2 | highway | primary | bar | 10,11 |
+ | W3 | highway | residential | foo | 10,12 |
When importing
Then placex contains
| object | parent_place_id | housenumber |
| W1 | W2 | 3 |
- | N1 | W3 | 3 |
- | N2 | W3 | 3 |
- | N3 | W2 | 3 |
+ | N1 | W2 | 3 |
When updating places
| osm | class | type | street | addr_place | housenr | geometry |
- | W1 | building | yes | foo | nowhere | 3 | :w-building |
+ | W1 | building | yes | foo | nowhere | 3 | (5,6,7,8,5) |
And updating places
- | osm | class | type | name | geometry |
- | N3 | shop | supermarket| well | :n-edge-WE |
+ | osm | class | type | name |
+ | N1 | amenity | bank | well |
Then placex contains
| object | parent_place_id | housenumber |
| W1 | W3 | 3 |
| N1 | W3 | 3 |
- | N2 | W3 | 3 |
- | N3 | W3 | 3 |
Scenario: Housenumber is reparented when street gets name matching addr:street
Given the places
| osm | class | type | addr+postcode | addr+housenumber | geometry |
| N34 | place | house | 01982 | 111 |country:de |
- | N35 | place | house | 01982 | 5 |country:ch |
+ | N35 | place | house | 01982 | 5 |country:fr |
When importing
And marking for delete N34
And updating postcodes
Then location_postcode contains exactly
| country | postcode | geometry |
- | ch | 01982 | country:ch |
+ | fr | 01982 | country:fr |
And there are word tokens for postcodes 01982
Scenario: Updating a postcode is reflected in postcode table
Testing simple updating functionality
Scenario: Do delete small boundary features
+ Given the 1.0 grid
+ | 1 | 2 |
+ | 4 | 3 |
Given the places
| osm | class | type | admin | geometry |
- | R1 | boundary | administrative | 3 | poly-area:1.0 |
+ | R1 | boundary | administrative | 3 | (1,2,3,4,1) |
When importing
Then placex contains
| object | rank_search |
Then placex has no entry for R1
Scenario: Do not delete large boundary features
+ Given the 2.0 grid
+ | 1 | 2 |
+ | 4 | 3 |
Given the places
| osm | class | type | admin | geometry |
- | R1 | boundary | administrative | 3 | poly-area:5.0 |
+ | R1 | boundary | administrative | 3 | (1,2,3,4,1) |
When importing
Then placex contains
| object | rank_search |
| R1 | 6 |
When marking for delete R1
- Then placex contains
+ Then placex contains
| object | rank_search |
| R1 | 6 |
Scenario: Do delete large features of low rank
+ Given the 2.0 grid
+ | 1 | 2 |
+ | 4 | 3 |
Given the named places
| osm | class | type | geometry |
- | W1 | place | house | poly-area:5.0 |
- | R1 | natural | wood | poly-area:5.0 |
- | R2 | highway | residential | poly-area:5.0 |
+ | W1 | place | house | (1,2,3,4,1) |
+ | R1 | natural | wood | (1,2,3,4,1) |
+ | R2 | highway | residential | (1,2,3,4,1) |
When importing
Then placex contains
| object | rank_address |
Scenario: remove postcode place when house number is added
Given the places
| osm | class | type | postcode | geometry |
- | N3 | place | postcode | 12345 | 1 -1 |
+ | N3 | place | postcode | 12345 | country:de |
When importing
Then placex has no entry for N3
When updating places
| osm | class | type | postcode | housenr | geometry |
- | N3 | place | house | 12345 | 13 | 1 -1 |
+ | N3 | place | house | 12345 | 13 | country:de |
Then placex contains
| object | class | type |
| N3 | place | house |
context.nominatim.reindex_placex(context.db)
+ # Remove the output of the input, when all was right. Otherwise it will be
+ # output when there are errors that had nothing to do with the import
+ # itself.
+ context.log_capture.buffer.clear()
+
################################ THEN ##################################
@then("(?P<table>placex|place) contains(?P<exact> exactly)?")