]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 11 Sep 2014 18:43:38 +0000 (20:43 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 11 Sep 2014 18:43:38 +0000 (20:43 +0200)
1  2 
sql/functions.sql

diff --combined sql/functions.sql
index 10e0091db467eee5b259c89c473dfc2416668097,e2bfbbbccf76b6bb29c16b140841e83dd76bbb68..54f46cfe933b64fbd5f33dfc9a6ac336ade93539
@@@ -936,11 -936,6 +936,11 @@@ DECLAR
  BEGIN
    --DEBUG: RAISE WARNING '% %',NEW.osm_type,NEW.osm_id;
  
 +  -- remove operator tag for most places, messes too much with search_name indexes
 +  IF NEW.class not in ('amenity', 'shop') THEN
 +    NEW.name := delete(NEW.name, 'operator');
 +  END IF;
 +
    -- just block these
    IF NEW.class in ('landuse','natural') and NEW.name is null THEN
  --    RAISE WARNING 'empty landuse %',NEW.osm_id;
              NEW.rank_address := 5;
            END IF;
  
+         ELSEIF NEW.calculated_country_code = 'sg' THEN
+           IF NEW.postcode ~ '^([0-9]{6})$' THEN
+             NEW.rank_search := 25;
+             NEW.rank_address := 11;
+           END IF;
          ELSEIF NEW.calculated_country_code = 'de' THEN
  
            IF NEW.postcode ~ '^([0-9]{5})$' THEN
@@@ -2067,11 -2069,6 +2074,11 @@@ BEGI
      --DEBUG: RAISE WARNING '%', existingplacex;
    END IF;
  
 +  -- remove operator tag for most places, messes too much with search_name indexes
 +  IF NEW.class not in ('amenity', 'shop') THEN
 +    NEW.name := delete(NEW.name, 'operator');
 +  END IF;
 +
    -- Just block these - lots and pointless
    IF NEW.class in ('landuse','natural') and NEW.name is null THEN
      -- if the name tag was removed, older versions might still be lurking in the place table
  
    END IF;
  
 +  -- refuse to update multiplpoygons with too many objects, too much of a performance hit
 +  IF ST_NumGeometries(NEW.geometry) > 2000 THEN
 +    RAISE WARNING 'Dropping update of % % because of geometry complexity.', NEW.osm_type, NEW.osm_id;
 +    RETURN NULL;
 +  END IF;
 +
    IF coalesce(existing.name::text, '') != coalesce(NEW.name::text, '')
       OR coalesce(existing.extratags::text, '') != coalesce(NEW.extratags::text, '')
       OR coalesce(existing.housenumber, '') != coalesce(NEW.housenumber, '')