]> git.openstreetmap.org Git - nominatim.git/commitdiff
replace final reference to way-node index with spatial lookup
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 25 Feb 2015 22:33:30 +0000 (23:33 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 5 Mar 2015 21:00:27 +0000 (22:00 +0100)
sql/functions.sql

index 8c14dc6eb670f6e91064db076711461038cb1140..194a64d7782490fc78cf22ce1934644ddc6b0332 100644 (file)
@@ -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;