[gdal-dev] Re: Problems with large raster sizes (WMS/TMS)

Even Rouault even.rouault at mines-paris.org
Fri Nov 13 13:27:47 EST 2009


Selon Tamas Szekeres <szekerest at gmail.com>:

> Hi Even,
>
> Yes, I thought it was a bit complicated issue. I would also support
> replacing the array of pointers with a hashtable to eliminate the
> unnecessary memory requirement. I've been looking at the code and
> found a hashset implementation in CPL which could probably be utilized
> here, however this one doesn't support to auto-grow and it should also
> store all the items with the same hash value (along with the key) in a
> linked list instead replacing each other. I don't think it would
> significantly slow down the lookup process since only the list of the
> same hash should be iterated.
>

Tamas,

Yes, I was exactly thinking at CPLHashSet. This can be used as a hashmap (and is
already used in gdaldataset.cpp for example to maintain the 'list' of opened
datasets) if you insert in it elements of a structure that has both the key and
value, and your hash and equal functions only hash and compare on the key part
of the structure.

But I'm surprised you claim it doesn't support auto-grow and cannot store items
with the same hash value : those both features are already implemented and
unless you prove me wrong, they work ;-)

Best regards,

Even




More information about the gdal-dev mailing list