]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 31 Mar 2015 21:09:55 +0000 (23:09 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 31 Mar 2015 21:09:55 +0000 (23:09 +0200)
Conflicts:
sql/functions.sql

1  2 
lib/Geocode.php
lib/lib.php
sql/functions.sql

diff --cc lib/Geocode.php
Simple merge
diff --cc lib/lib.php
Simple merge
index afa687be1ee7fcd613a751d6582f951e26df8ccb,e404da7cf26ef5a667a23876f346ed9e864be7d2..a5d0f6a02c742392843b396f6db90fda4ee09a12
@@@ -2271,54 -2034,7 +2034,13 @@@ BEGI
  
    END IF;
  
-   -- Special case - if we are just adding extra words we hack them into the search_name table rather than reindexing
-   IF FALSE AND existingplacex.rank_search < 26
-      AND coalesce(existing.housenumber, '') = coalesce(NEW.housenumber, '')
-      AND coalesce(existing.street, '') = coalesce(NEW.street, '')
-      AND coalesce(existing.addr_place, '') = coalesce(NEW.addr_place, '')
-      AND coalesce(existing.isin, '') = coalesce(NEW.isin, '')
-      AND coalesce(existing.postcode, '') = coalesce(NEW.postcode, '')
-      AND coalesce(existing.country_code, '') = coalesce(NEW.country_code, '')
-      AND coalesce(existing.name::text, '') != coalesce(NEW.name::text, '') 
-      THEN
-     IF NOT update_location_nameonly(existingplacex.place_id, NEW.name) THEN
-       IF st_area(NEW.geometry) < 0.5 THEN
-         UPDATE placex set indexed_status = 2 from place_addressline where address_place_id = existingplacex.place_id 
-           and placex.place_id = place_addressline.place_id and indexed_status = 0
-           and (rank_search < 28 or name is not null);
-       END IF;
-     END IF;
-   
-   ELSE
-     -- Anything else has changed - reindex the lot
-     IF coalesce(existing.name::text, '') != coalesce(NEW.name::text, '')
-         OR coalesce(existing.housenumber, '') != coalesce(NEW.housenumber, '')
-         OR coalesce(existing.street, '') != coalesce(NEW.street, '')
-         OR coalesce(existing.addr_place, '') != coalesce(NEW.addr_place, '')
-         OR coalesce(existing.isin, '') != coalesce(NEW.isin, '')
-         OR coalesce(existing.postcode, '') != coalesce(NEW.postcode, '')
-         OR coalesce(existing.country_code, '') != coalesce(NEW.country_code, '') THEN
-       -- performance, can't take the load of re-indexing a whole country / huge area
-       IF st_area(NEW.geometry) < 0.5 THEN
- --        UPDATE placex set indexed_status = 2 from place_addressline where address_place_id = existingplacex.place_id 
- --          and placex.place_id = place_addressline.place_id and indexed_status = 0;
-       END IF;
-     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, '')
       OR coalesce(existing.housenumber, '') != coalesce(NEW.housenumber, '')