1 Feature: Updates of linked places
 
   2     Tests that linked places are correctly added and deleted.
 
   4     Scenario: Linking is kept when boundary is updated
 
  10             | osm | class | type | name |
 
  11             | N1  | place | city | foo  |
 
  13             | osm | class    | type           | name | admin | geometry |
 
  14             | R1  | boundary | administrative | foo  | 8     | (10,11,12,13,10) |
 
  17          | object | linked_place_id |
 
  20          | osm | class    | type           | name | name+name:de | admin | geometry |
 
  21          | R1  | boundary | administrative | foo  | Dingens      | 8     | (10,11,12,13,10) |
 
  23          | object | linked_place_id |
 
  27     Scenario: Add linked place when linking relation is renamed
 
  33             | osm | class | type | name |
 
  34             | N1  | place | city | foo  |
 
  36             | osm | class    | type           | name | admin | geometry |
 
  37             | R1  | boundary | administrative | foo  | 8     | (10,11,12,13,10) |
 
  40          | object | linked_place_id |
 
  45         Then all results contain
 
  49          | osm | class    | type           | name   | admin | geometry |
 
  50          | R1  | boundary | administrative | foobar | 8     | (10,11,12,13,10) |
 
  52          | object | linked_place_id |
 
  57         Then all results contain
 
  61     Scenario: Add linked place when linking relation is removed
 
  67             | osm | class | type | name |
 
  68             | N1  | place | city | foo  |
 
  70             | osm | class    | type           | name | admin | geometry |
 
  71             | R1  | boundary | administrative | foo  | 8     | (10,11,12,13,10) |
 
  76         Then all results contain
 
  79         When marking for delete R1
 
  81          | object | linked_place_id |
 
  86         Then all results contain
 
  90     Scenario: Remove linked place when linking relation is added
 
  96             | osm | class | type | name |
 
  97             | N1  | place | city | foo  |
 
 102         Then all results contain
 
 106          | osm | class    | type           | name   | admin | geometry |
 
 107          | R1  | boundary | administrative | foo    | 8     | (10,11,12,13,10) |
 
 109          | object | linked_place_id |
 
 114         Then all results contain
 
 118     Scenario: Remove linked place when linking relation is renamed
 
 124             | osm | class | type | name |
 
 125             | N1  | place | city | foo  |
 
 127          | osm | class    | type           | name   | admin | geometry |
 
 128          | R1  | boundary | administrative | foobar | 8     | (10,11,12,13,10) |
 
 133         Then all results contain
 
 137          | osm | class    | type           | name   | admin | geometry |
 
 138          | R1  | boundary | administrative | foo    | 8     | (10,11,12,13,10) |
 
 140          | object | linked_place_id |
 
 145         Then all results contain
 
 149     Scenario: Update linking relation when linkee name is updated
 
 155          | osm | class    | type           | name | admin | geometry |
 
 156          | R1  | boundary | administrative | rel  | 8     | (10,11,12,13,10) |
 
 158          | osm | class    | type        | name+name:de |
 
 159          | N3  | place    | city        | greeny       |
 
 165          | object | linked_place_id | name+_place_name:de |
 
 168          | object | linked_place_id | name+name:de |
 
 171          | osm | class    | type        | name+name:de |
 
 172          | N3  | place    | city        | newname      |
 
 174          | object | linked_place_id | name+name:de |
 
 175          | N3     | R1              | newname  |
 
 177          | object | linked_place_id | name+_place_name:de |
 
 180     Scenario: Update linking relation when linkee name is deleted
 
 186          | osm | class    | type           | name | admin | geometry |
 
 187          | R1  | boundary | administrative | rel  | 8     | (10,11,12,13,10) |
 
 189          | osm | class    | type           | name |
 
 190          | N3  | place    | city           | greeny  |
 
 196          | object | linked_place_id | name+_place_name | name+name |
 
 197          | R1     | -               | greeny              | rel       |
 
 199          | object | linked_place_id | name+name |
 
 201         When geocoding "greeny"
 
 202         Then all results contain
 
 206          | osm | class    | type        | name+name:de |
 
 207          | N3  | place    | city        | depnt        |
 
 209          | object | linked_place_id | name+name:de |
 
 212          | object | linked_place_id | name+_place_name:de | name+name |
 
 213          | R1     | -               | depnt               | rel       |
 
 214         When geocoding "greeny"
 
 215         Then exactly 0 results are returned
 
 217     Scenario: Updating linkee extratags keeps linker's extratags
 
 222         Given the named places
 
 223          | osm | class    | type           | extra+wikidata | admin | geometry |
 
 224          | R1  | boundary | administrative | 34             | 8     | (10,11,12,13,10) |
 
 226          | osm | class    | type           |
 
 227          | N3  | place    | city           |
 
 233          | object | extratags!dict |
 
 234          | R1     | 'wikidata' : '34', 'linked_place' : 'city' |
 
 236          | osm | class    | type        | name    | extra+oneway |
 
 237          | N3  | place    | city        | newname | yes          |
 
 239          | object | extratags!dict |
 
 240          | R1     | 'wikidata' : '34', 'oneway' : 'yes', 'linked_place' : 'city' |
 
 242     Scenario: Remove linked_place info when linkee is removed
 
 248             | osm | class | type | name |
 
 249             | N1  | place | city | foo  |
 
 251             | osm | class    | type           | name | admin | geometry |
 
 252             | R1  | boundary | administrative | foo  | 8     | (10,11,12,13,10) |
 
 255             | object | extratags!dict |
 
 256             | R1     | 'linked_place' : 'city' |
 
 257         When marking for delete N1
 
 259             | object | extratags |
 
 262     Scenario: Update linked_place info when linkee type changes
 
 268             | osm | class | type | name |
 
 269             | N1  | place | city | foo  |
 
 271             | osm | class    | type           | name | admin | geometry |
 
 272             | R1  | boundary | administrative | foo  | 8     | (10,11,12,13,10) |
 
 275             | object | extratags!dict |
 
 276             | R1     | 'linked_place' : 'city' |
 
 278             | osm | class | type | name |
 
 279             | N1  | place | town | foo  |
 
 281             | object | extratags!dict |
 
 282             | R1     | 'linked_place' : 'town' |
 
 285     Scenario: Keep linking and ranks when place type changes
 
 291             | osm | class    | type           | name | admin | geometry    |
 
 292             | R1  | boundary | administrative | foo  | 8     | (1,2,3,4,1) |
 
 294             | osm | class | type | name | geometry |
 
 295             | N1  | place | city | foo  | 9        |
 
 298             | object | linked_place_id | rank_address |
 
 303             | osm | class | type | name | geometry |
 
 304             | N1  | place | town | foo  | 9        |
 
 306             | object | linked_place_id | rank_address |
 
 311     Scenario: Invalidate surrounding place nodes when place type changes
 
 317             | osm | class    | type           | name | admin | geometry    |
 
 318             | R1  | boundary | administrative | foo  | 8     | (1,2,3,4,1) |
 
 320             | osm | class | type | name | geometry |
 
 321             | N1  | place | town | foo  | 9        |
 
 322             | N2  | place | city | bar  | 8        |
 
 328             | object | linked_place_id | rank_address |
 
 334             | osm | class | type   | name | geometry |
 
 335             | N1  | place | suburb | foo  | 9        |
 
 337             | object | linked_place_id | rank_address |