-- one with the smallest id because the original node was created first.
-- Ignore all nodes marked for deletion. (Might happen when the type changes.)
select * from placex where osm_type = 'N' and osm_id = waynodes[nodeidpos]::BIGINT
- and indexed_status < 100
+ and indexed_status < 100 and housenumber is not NULL
order by (type = 'address'),place_id limit 1 INTO nextnode;
IF nextnode.place_id IS NOT NULL THEN
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, '')