[osmosis-dev] API 0.6 and unique keys
marcus.wolschon at googlemail.com
marcus.wolschon at googlemail.com
Thu Jan 29 07:01:43 GMT 2009
On Wed, 28 Jan 2009 09:20:23 +0100, Jochen Topf <jochen at remote.org> wrote:
> On Wed, Jan 28, 2009 at 08:29:14AM +0100, marcus.wolschon at googlemail.com
> wrote:
>> I just learned on OSM-dev that in 0.6 you can no longer
>> have more then one value for any key on an entity.
>>
>> Any chance we can use this to replace the Tag-class with
>> a simple read-only Hashtable in the v0_6.Entity -class?
>
> I am not sure this is actually a win. The normal case is just two or
> three tags per entity. Creating a hash table with the associated memory
> overhead for so few keys is probably more expensive then the one or two
> full array scans you do to get the tags out again.
If it's about memory, then storing a simple String-array internally instead
of
Tag-instances and providing get(key), containsKey(key) and iterator() will
require even less heap then the current implementation and allow for
shorter
code in filtering on tag- names. As the tag-list is immutable, the
array-size
is fixed anyway.
What I do with it is routing, searching and painting, thus heavy filtering
on tags
and I am starting to export a lot of the preprocessing, indexing and
filtering
as osmosis- plugins to be usable by many other applications too.
Marcus
More information about the osmosis-dev
mailing list