]> git.openstreetmap.org Git - nominatim.git/commitdiff
remove farms and isolated dwellings from computed addresses
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 20 Dec 2024 21:59:02 +0000 (22:59 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 20 Dec 2024 21:59:02 +0000 (22:59 +0100)
Farms and isolated dwellings are usually confined to a very small
area. It does not make sense if they are automatically used in
addressing surrounding features. Still works to use them for
parenting when used with addr:place.

settings/address-levels.json
test/bdd/db/import/rank_computation.feature

index a82133ef0d1e17b2c9e0aeadf88451334769dff2..322ff707d1ad3a8a799e217a9079a598de672c50 100644 (file)
@@ -23,8 +23,8 @@
           "allotments" : 22,
           "neighbourhood" : [20, 22],
           "quarter" : [20, 22],
-          "isolated_dwelling" : [22, 20],
-          "farm" : [22, 20],
+          "isolated_dwelling" : [22, 25],
+          "farm" : [22, 25],
           "city_block" : 25,
           "mountain_pass" : 25,
           "square" : 25,
index df01fd915d33e5ddacdfccc8f3ef932184f6a04a..0fce3e71091b7b27574b70e42a7fbf69736c82ca 100644 (file)
@@ -267,3 +267,34 @@ Feature: Rank assignment
           | object      | rank_search | rank_address |
           | N23:amenity | 30          | 30           |
           | N23:place   | 16          | 16           |
+
+    Scenario: Address rank 25 is only used for addr:place
+        Given the grid
+           | 10 | 33 | 34 | 11 |
+        Given the places
+          | osm | class | type    | name |
+          | N10 | place | village | vil  |
+          | N11 | place | farm    | farm |
+        And the places
+          | osm | class   | type        | name | geometry |
+          | W1  | highway | residential | RD   | 33,11    |
+        And the places
+          | osm | class   | type        | name | addr+farm | geometry |
+          | W2  | highway | residential | RD2  | farm       | 34,11    |
+        And the places
+          | osm | class | type  | housenr |
+          | N33 | place | house | 23      |
+        And the places
+          | osm | class | type  | housenr | addr+place |
+          | N34 | place | house | 23      | farm       |
+        When importing
+        Then placex contains
+          | object | parent_place_id |
+          | N11    | N10             |
+          | N33    | W1              |
+          | N34    | N11             |
+        And place_addressline contains
+          | object | address |
+          | W1     | N10     |
+          | W2     | N10     |
+          | W2     | N11     |