]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/swf_controller.rb
Use tile based queries for unwayed segments.
[rails.git] / app / controllers / swf_controller.rb
index 2200ab6525bc4865b427aaeeab2104730150ece9..628a95e064ceda1e4043c73faf63650bb6cfd76e 100644 (file)
@@ -1,6 +1,6 @@
 class SwfController < ApplicationController
        session :off
-       before_filter :check_availability
+       before_filter :check_read_availability
 
 # to log:
 # RAILS_DEFAULT_LOGGER.error("Args: #{args[0]}, #{args[1]}, #{args[2]}, #{args[3]}")
@@ -95,8 +95,7 @@ class SwfController < ApplicationController
                                "       LEFT OUTER JOIN current_way_segments"+
                                "       ON segment_id=current_segments.id,"+
                                "       current_nodes AS cn1,current_nodes AS cn2"+
-                               " WHERE (cn1.longitude BETWEEN #{xmin} AND #{xmax})"+
-                               "   AND (cn1.latitude  BETWEEN #{ymin} AND #{ymax})"+
+                               " WHERE "+OSM.sql_for_area(ymin,xmin,ymax,xmax,"cn1.")+
                                "   AND segment_id IS NULL"+
                                "   AND current_segments.visible=1"+
                                "   AND cn1.id=node_a AND cn1.visible=1"+