From: Sarah Hoffmann Date: Fri, 20 Apr 2012 21:19:52 +0000 (+0200) Subject: Merge branch 'continent' of https://github.com/datendelphin/Nominatim X-Git-Tag: v2.0.0~83 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/7b430bc731ee68005a7b52bb2a22f53914011381?ds=inline;hp=-c Merge branch 'continent' of https://github.com/datendelphin/Nominatim --- 7b430bc731ee68005a7b52bb2a22f53914011381 diff --combined sql/functions.sql index d10439df,7a68718e..b248a46d --- a/sql/functions.sql +++ b/sql/functions.sql @@@ -909,7 -909,12 +909,12 @@@ BEGI NEW.place_id := nextval('seq_place'); NEW.indexed_status := 1; --STATUS_NEW - NEW.country_code := lower(get_country_code(NEW.geometry, NEW.country_code)); + IF NEW.rank_search >= 4 THEN + NEW.country_code := lower(get_country_code(NEW.geometry, NEW.country_code)); + ELSE + NEW.country_code := NULL; + END IF; + NEW.partition := get_partition(NEW.geometry, NEW.country_code); NEW.geometry_sector := geometry_sector(NEW.partition, NEW.geometry); @@@ -1037,10 -1042,6 +1042,10 @@@ ELSEIF NEW.type in ('farm','locality','islet','isolated_dwelling','mountain_pass') THEN NEW.rank_search := 20; NEW.rank_address := 0; + -- Irish townlands, tagged as place=locality and locality=townland + IF (NEW.extratags -> 'locality') = 'townland' THEN + NEW.rank_address := 20; + END IF; ELSEIF NEW.type in ('hall_of_residence','neighbourhood','housing_estate','nature_reserve') THEN NEW.rank_search := 22; NEW.rank_address := 22; @@@ -1256,8 -1257,12 +1261,12 @@@ BEGI END IF; -- reclaculate country and partition (should probably have a country_code and calculated_country_code as seperate fields) - SELECT country_code from place where osm_type = NEW.osm_type and osm_id = NEW.osm_id and class = NEW.class and type = NEW.type INTO NEW.country_code; - NEW.country_code := lower(get_country_code(NEW.geometry, NEW.country_code)); + IF NEW.rank_search >= 4 THEN + SELECT country_code from place where osm_type = NEW.osm_type and osm_id = NEW.osm_id and class = NEW.class and type = NEW.type INTO NEW.country_code; + NEW.country_code := lower(get_country_code(NEW.geometry, NEW.country_code)); + ELSE + NEW.country_code := NULL; + END IF; NEW.partition := get_partition(NEW.geometry, NEW.country_code); NEW.geometry_sector := geometry_sector(NEW.partition, NEW.geometry);