From: Sarah Hoffmann Date: Wed, 25 Mar 2015 21:32:54 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~471 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/3ce0917874b55d8013d8bb37113e42dfb0c8b452?hp=-c Merge remote-tracking branch 'upstream/master' --- 3ce0917874b55d8013d8bb37113e42dfb0c8b452 diff --combined sql/functions.sql index 96b5eaaf,02cdc680..afa687be --- a/sql/functions.sql +++ b/sql/functions.sql @@@ -1642,7 -1642,7 +1642,7 @@@ BEGI -- Performance, it would be more acurate to do all the rest of the import process but it takes too long -- Just be happy with inheriting from parent road only - IF NEW.rank_search <= 25 THEN + IF NEW.rank_search <= 25 and NEW.rank_address > 0 THEN result := add_location(NEW.place_id, NEW.calculated_country_code, NEW.partition, name_vector, NEW.rank_search, NEW.rank_address, NEW.geometry); END IF; @@@ -1978,7 -1978,7 +1978,7 @@@ -- if we have a name add this to the name search table IF NEW.name IS NOT NULL THEN - IF NEW.rank_search <= 25 THEN + IF NEW.rank_search <= 25 and NEW.rank_address > 0 THEN result := add_location(NEW.place_id, NEW.calculated_country_code, NEW.partition, name_vector, NEW.rank_search, NEW.rank_address, NEW.geometry); END IF; @@@ -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 @@@ -2312,12 -2307,6 +2312,12 @@@ 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, '')