X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/82843524366aaca76cdb58b6f7ecb25e0af769fb..60817dedf0066dc0415897015a68bafa3cbc69b2:/app/models/trace.rb diff --git a/app/models/trace.rb b/app/models/trace.rb index ba255e85d..92cc39678 100644 --- a/app/models/trace.rb +++ b/app/models/trace.rb @@ -72,6 +72,16 @@ class Trace < ActiveRecord::Base "/home/osm/gpx/#{id}.gpx" end + def mime_type + return `file -bi #{trace_name}`.chomp + end + + def to_xml + doc = OSM::API.new.get_xml_doc + doc.root << to_xml_node() + return doc + end + def to_xml_node el1 = XML::Node.new 'gpx_file' el1['id'] = self.id.to_s