]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 23 Mar 2015 21:01:52 +0000 (22:01 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 23 Mar 2015 21:01:52 +0000 (22:01 +0100)
1  2 
sql/functions.sql

diff --combined sql/functions.sql
index c3590c1ebb837a3d6a65b78969019550a205bf91,5f52a6a9f1a3bb6825fe204c28d4895a2e09ac00..96b5eaafd6238eb9b2630ed4cb6fecada500de8e
@@@ -1734,7 -1734,7 +1734,7 @@@ BEGI
      END IF;
  
      -- Name searches can be done for ways as well as relations
-     IF NEW.osm_type in ('W','R') AND NEW.rank_search < 26 THEN
+     IF NEW.osm_type in ('W','R') AND NEW.rank_search < 26 AND NEW.rank_address > 0 THEN
  
        -- not found one yet? how about doing a name search
        IF NEW.centroid IS NULL AND (NEW.name->'name') is not null and make_standard_name(NEW.name->'name') != '' THEN
@@@ -2118,11 -2118,6 +2118,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;
  
    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, '')