[OSM-dev] JOSM: Several tags with same key

Matt Amos zerebubuth at gmail.com
Thu Apr 2 23:52:50 BST 2009


On Thu, Apr 2, 2009 at 11:35 PM, Stefan de Konink <stefan at konink.de> wrote:
> Matt Amos wrote:
>> the API uses a hash and disallows repeated tags on ways and relations.
>> but it uses a list for nodes, so you can easily get duplicate tags by
>> the method you describe.
>
> Interesting; I am not convinced but I'll look into it.

the Node.from_xml method appends tags into an array:
http://trac.openstreetmap.org/browser/sites/rails_port/app/models/node.rb#L90

the way and relation from_xml methods call add_tag_keyval, which makes
a Hash container:
http://trac.openstreetmap.org/browser/sites/rails_port/app/models/way.rb#L156
http://trac.openstreetmap.org/browser/sites/rails_port/app/models/relation.rb#L172

hope that helps,

matt




More information about the dev mailing list