]> git.openstreetmap.org Git - nominatim.git/commitdiff
generally remove all country and state places from address
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 19 Jun 2019 21:16:43 +0000 (23:16 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 30 Jun 2019 20:27:44 +0000 (22:27 +0200)
Gets rid of the hard-coded expection for place nodes and sets
the address rank generally via the address level config instead.
That means only administrative boundaries are now used at that
level in addresses.

settings/address-levels.json
sql/functions.sql

index c29266ac7a749aee1c808f87fb6e0986b0a5cb05..8a47f7e5e0ce5e77ccb77f839fa1e417513d4b4a 100644 (file)
@@ -3,8 +3,8 @@
       "place" : {
           "sea" : [2, 0],
           "continent" : [2, 0],
-          "country" : [4, 4],
-          "state" : [8, 8],
+          "country" : [4, 0],
+          "state" : [8, 0],
           "region" : [18, 0],
           "county" : 12,
           "city" : 16,
index 8a5c9bc53cc522a3adad309ff0d91c8f10d4d3e4..0cfeaf0cff0ad9cf2f0414764625c31804c8df2d 100644 (file)
@@ -887,11 +887,7 @@ BEGIN
     END IF;
 
     -- some postcorrections
-    IF NEW.class = 'place' THEN
-      IF NEW.type in ('continent', 'sea', 'country', 'state') AND NEW.osm_type = 'N' THEN
-        NEW.rank_address := 0;
-      END IF;
-    ELSEIF NEW.class = 'waterway' AND NEW.osm_type = 'R' THEN
+    IF NEW.class = 'waterway' AND NEW.osm_type = 'R' THEN
         -- Slightly promote waterway relations so that they are processed
         -- before their members.
         NEW.rank_search := NEW.rank_search - 1;
@@ -908,11 +904,6 @@ BEGIN
     NEW.country_code := NULL;
   END IF;
 
--- Block import below rank 22
---  IF NEW.rank_search > 22 THEN
---    RETURN NULL;
---  END IF;
-
   --DEBUG: RAISE WARNING 'placex_insert:END: % % % %',NEW.osm_type,NEW.osm_id,NEW.class,NEW.type;
 
   RETURN NEW; -- %DIFFUPDATES% The following is not needed until doing diff updates, and slows the main index process down