From: Sarah Hoffmann Date: Wed, 25 Feb 2015 22:33:30 +0000 (+0100) Subject: replace final reference to way-node index with spatial lookup X-Git-Tag: v2.4.0~19 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/1eb52879c6d3d4a4af42030b99fcdfdecb5dc541?ds=inline;hp=27ce2afbcfa81de6651a16eda311cb109b2a8ba4 replace final reference to way-node index with spatial lookup --- diff --git a/sql/functions.sql b/sql/functions.sql index 8c14dc6e..194a64d7 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1546,9 +1546,9 @@ BEGIN --RAISE WARNING 'x1'; -- Is this node part of a way? - FOR way IN select id from planet_osm_ways where nodes @> ARRAY[NEW.osm_id] LOOP ---RAISE WARNING '%', way; - FOR location IN select * from placex where osm_type = 'W' and osm_id = way.id + FOR location IN select p.* from placex p, planet_osm_ways w + where p.osm_type = 'W' and p.rank_search >= 26 + and p.geometry && NEW.geometry and p.osm_id = w.id and NEW.osm_id = any(w.nodes) LOOP --RAISE WARNING '%', location; -- Way IS a road then we are on it - that must be our road @@ -1599,7 +1599,6 @@ BEGIN END IF; END LOOP; - END LOOP; END IF;