Use tile based query when creating a way from unwayed segments.
authorTom Hughes <tom@compton.nu>
Fri, 21 Sep 2007 16:25:18 +0000 (16:25 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 21 Sep 2007 16:25:18 +0000 (16:25 +0000)
app/controllers/amf_controller.rb

index 3cb93c1aecef1340eb5f5a0759fa449be18ae2f8..8132b5311b5d412d631517b20457d5388f94a699 100644 (file)
@@ -610,8 +610,7 @@ def makeway(args)
                       current_nodes AS cn2,
                       current_segments AS cs 
                       LEFT OUTER JOIN current_way_segments ON segment_id=cs.id 
-                WHERE (cn1.longitude BETWEEN #{xs1} AND #{xs2}) 
-                  AND (cn1.latitude  BETWEEN #{ys1} AND #{ys2}) 
+                WHERE #{OSM.sql_for_area(ys1,xs1,ys2,xs2,"cn1.")}
                   AND segment_id IS NULL 
                    AND cs.visible=1
                   AND cn1.id=node_a AND cn1.visible=1