2 def add_metadata_to_xml_node(el, osm, changeset_cache, user_display_name_cache)
3 el['changeset'] = osm.changeset_id.to_s
4 el['redacted'] = osm.redaction.id.to_s if osm.redacted?
5 el['timestamp'] = osm.timestamp.xmlschema
6 el['version'] = osm.version.to_s
7 el['visible'] = osm.visible.to_s
9 if changeset_cache.key?(osm.changeset_id)
10 # use the cache if available
12 changeset_cache[osm.changeset_id] = osm.changeset.user_id
15 user_id = changeset_cache[osm.changeset_id]
17 if user_display_name_cache.key?(user_id)
18 # use the cache if available
19 elsif osm.changeset.user.data_public?
20 user_display_name_cache[user_id] = osm.changeset.user.display_name
22 user_display_name_cache[user_id] = nil
25 unless user_display_name_cache[user_id].nil?
26 el['user'] = user_display_name_cache[user_id]
27 el['uid'] = user_id.to_s
31 def add_tags_to_xml_node(el, tags)
33 tag_el = XML::Node.new('tag')