w := getorcreate_word_id(s);
- IF NOT (ARRAY[w] <@ result) THEN
+ IF w IS NOT NULL AND NOT (ARRAY[w] <@ result) THEN
result := result || w;
END IF;
w := getorcreate_word_id(s);
- IF NOT (ARRAY[w] <@ result) THEN
+ IF w IS NOT NULL AND NOT (ARRAY[w] <@ result) THEN
result := result || w;
END IF;
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;
--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
RETURN null;
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, '')