X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6020e0519e20580364374d209420d519181621b2..2c98558c86f50a26b96d4b0feebdb93195a10455:/app/controllers/way_controller.rb?ds=sidebyside diff --git a/app/controllers/way_controller.rb b/app/controllers/way_controller.rb index 34f1ab5e7..e7eead52f 100644 --- a/app/controllers/way_controller.rb +++ b/app/controllers/way_controller.rb @@ -135,4 +135,19 @@ class WayController < ApplicationController end end + def ways_for_segment + response.headers["Content-Type"] = 'text/xml' + wayids = WaySegment.find(:all, :conditions => ['segment_id = ?', params[:id]]).collect { |ws| ws.id }.uniq + if wayids.length > 0 + waylist = Way.find(wayids) + doc = OSM::API.new.get_xml_doc + waylist.each do |way| + doc.root << way.to_xml_node + end + render :text => doc.to_s + else + render :nothing => true, :status => 400 + end + end + end