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

diff --combined sql/functions.sql
index d86f4a9be321dfb69e8d07847a13ac4e8670199c,5c4cea053a6f05787e0f3d8da86fbf88dbabc354..ac726cb331a66366a090073bcd87fa260cb5c8e5
@@@ -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;
@@@ -1377,7 -1372,7 +1377,7 @@@ BEGI
  
      -- waterway ways are linked when they are part of a relation and have the same class/type
      IF NEW.osm_type = 'R' and NEW.class = 'waterway' THEN
-         FOR relation IN select * from planet_osm_rels r where r.id = NEW.osm_id
+         FOR relation IN select * from planet_osm_rels r where r.id = NEW.osm_id and r.parts != array[]::bigint[]
          LOOP
              FOR i IN 1..array_upper(relation.members, 1) BY 2 LOOP
                  IF relation.members[i+1] in ('', 'main_stream') AND substring(relation.members[i],1,1) = 'w' THEN
@@@ -2064,11 -2059,6 +2064,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, '')