Range of values for a tilekey's x & y members

classic Classic list List threaded Threaded
3 messages Options
DanielMartin DanielMartin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Range of values for a tilekey's x & y members

Hello,

I was wondering, is there a maximum value for a tilekey's x & y unsigned int members at a given LOD?
Is this something I can calculate out? I'm hoping to write a hashing function to create unique keys for lookup using a combination of the tilekeys lod, x, and y.

Thanks!

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Range of values for a tilekey's x & y members

Daniel,

Yes; you can call tileKey->getProfile()->getNumTiles(lod, x, y) to get this information.

You could also just call tileKey->str() and use that as your unique hashing key. OR you can use the TileKey object itself as the key in a std::map since it already implements an operator< function.

Hope this helps!
Glenn Waldron / Pelican Mapping
DanielMartin DanielMartin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Range of values for a tilekey's x & y members

Oh, awesome! This is exactly what I'm looking for! Originally we were going to use the TileKey::str(), but there were some concerns about using a string as a key re: speed and performance (it needs to be extra zippy), but I suppose it wouldn't hurt to profile that out.

Thanks!
Loading...