+
+
+ Scenario: addr:* tags always match the closer area
+ Given the grid
+ | 1 | | | | 2 | | 5 |
+ | | | | | | | |
+ | | 10| 11| | | | |
+ | 4 | | | | 3 | | 6 |
+ And the places
+ | osm | class | type | admin | name | geometry |
+ | R1 | boundary | administrative | 8 | Left | (1,2,3,4,1) |
+ | R2 | boundary | administrative | 8 | Left | (2,3,6,5,2) |
+ And the places
+ | osm | class | type | name | addr+city | geometry |
+ | W1 | highway | primary | Wonderway | Left | 10,11 |
+ When importing
+ Then place_addressline doesn't contain
+ | object | address |
+ | W1 | R2 |
+
+ Scenario: Full name is prefered for unlisted addr:place tags
+ Given the grid
+ | | 1 | 2 | |
+ | 8 | | | 9 |
+ And the places
+ | osm | class | type | name | geometry |
+ | W10 | place | city | Away | (8,1,2,9,8) |
+ And the places
+ | osm | class | type | name | addr+city | geometry |
+ | W1 | highway | residential | Royal Terrace | Gardens | 8,9 |
+ And the places
+ | osm | class | type | housenr | addr+place | geometry | extra+foo |
+ | N1 | place | house | 1 | Royal Terrace Gardens | 1 | bar |
+ And the places
+ | osm | class | type | housenr | addr+street | geometry |
+ | N2 | place | house | 2 | Royal Terrace | 2 |
+ When importing
+ When sending search query "1, Royal Terrace Gardens"
+ Then results contain
+ | ID | osm |
+ | 0 | N1 |