]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 10 Sep 2014 19:47:52 +0000 (21:47 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 10 Sep 2014 19:47:52 +0000 (21:47 +0200)
1  2 
sql/functions.sql

diff --combined sql/functions.sql
index 7b06b450ac54f6f61c32eb5f169e50f5e5a3a908,2c415620a40cf5dfa70cd6fc62bae646ba970e57..10e0091db467eee5b259c89c473dfc2416668097
@@@ -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;
@@@ -2067,11 -2062,6 +2067,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
    -- Handle a place changing type by removing the old data
    -- My generated 'place' types are causing havok because they overlap with real keys
    -- TODO: move them to their own special purpose key/class to avoid collisions
-   IF existing.osm_type IS NULL AND (NEW.type not in ('postcode','house','houses')) THEN
-     DELETE FROM place where osm_type = NEW.osm_type and osm_id = NEW.osm_id and class = NEW.class and type not in ('postcode','house','houses');
+   IF existing.osm_type IS NULL THEN
+     DELETE FROM place where osm_type = NEW.osm_type and osm_id = NEW.osm_id and class = NEW.class;
    END IF;
  
    --DEBUG: RAISE WARNING 'Existing: %',existing.osm_id;
  
    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, '')