end
def to_xml
- doc = XML::Document.new
- doc.encoding = 'UTF-8'
- root = XML::Node.new 'osm'
- root['version'] = '0.4'
- root['generator'] = 'OpenStreetMap server'
-
- doc.root = root
-
- root << to_xml_node()
+ doc = OSM::API.new.get_xml_doc
+ doc.root << to_xml_node()
return doc
end
def segs
- @segs = Array.new unless @segs
+ unless @segs
+ @segs = Array.new
+ self.way_segments.each do |seg|
+ @segs += [seg.segment_id]
+ end
+ end
@segs
end
def tags
- @tags = Hash.new unless @tags
+ unless @tags
+ @tags = Hash.new
+ self.way_tags.each do |tag|
+ @tags[tag.k] = tag.v
+ end
+ end
@tags
end