[OSM-dev] Objects with the same key multiple times?

Luka Frelih luka at ljudmila.org
Tue Oct 2 16:28:51 BST 2007


>> Should we encourage people to use multiple keys and raise bugs against
>> the applications to support this?
>> Or should we advocate using a single unique key tag and use something
>> like ':' to split multiple entries in the value field.
>>     
>
> I know it's the cheap way out but as a developer I'd really like to
> drop these "multi tags" because working with hash tables for the tags
> is so convenient
there is no real need to drop the hash for supporting the multi tags. an 
array hanging off the single key can store the multiple values.

it takes some bookkeeping as you probably want to create an array only 
when there actually are 2 or more tags with the same key on the object, 
not always. this is easy to do in dynamic languages, might take some 
more effort with static typing like java has.

i think searching the database for a specific tag key=value would be 
very hard (and slow for lack of indexing) when the actual record is 
key=something;value;another_thing

LF





More information about the dev mailing list