X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/3698ff353e2d40255ab9199473e6b755f513a202..e5a5f957ef46d76ec78e2c0450b50a086dff82b6:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index f4f762a39..38c567734 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -6,6 +6,10 @@ class AmfController < ApplicationController # - user authentication # - (also pass lat/lon through from view tab to edit tab) +# to log: +# RAILS_DEFAULT_LOGGER.error("Args: #{args[0]}, #{args[1]}, #{args[2]}, #{args[3]}") + + # ==================================================================== # Main AMF handler @@ -89,11 +93,56 @@ class AmfController < ApplicationController end def whichways(args) - # to do + waylist=WaySegment.find_by_sql("SELECT DISTINCT current_way_segments.id AS wayid"+ + " FROM current_way_segments,current_segments,current_nodes "+ + " WHERE segment_id=current_segments.id "+ + " AND node_a=current_nodes.id "+ + " AND (latitude BETWEEN "+(args[1].to_f-0.01).to_s+" AND "+(args[3].to_f+0.01).to_s+") "+ + " AND (longitude BETWEEN "+(args[0].to_f-0.01).to_s+" AND "+(args[2].to_f+0.01).to_s+")") + ways=[] + waylist.each {|a| + ways<