[ka-Map-users] Calculating number of tiles in cache

Paul Spencer pspencer at dmsolutions.ca
Fri Feb 3 10:18:10 EST 2006


Shoaib,

scale is actually 'unitless' :)  The calculations look correct but I  
honestly haven't put a lot of time into it.  It would be very cool if  
someone wrote a script to do this calculation ... I would hope it  
would read the config file and get the map files and scales from  
there and tell you the potential ka-cache size in tiles :)

Cheers

Paul

On 3-Feb-06, at 7:30 AM, Shoaib Burq wrote:

> Thanks heaps Paul
>
> I was having trouble with converting geographic extents to pixels for
> a given scale
> Then realized the scale is worked out in inches...
> so now i'm doing this:
>
> CellSize @ given scale = Scale/(image resolution * inches-per-mapUnit)
> PixelExtents = (GeoExtents * inches-per-mapUnit)/CellsSize
> Num-of-Tiles = PixelExtents/TileSize
> Total Tiles = Num-of-Tiles * Num-of-Tiles  ... (assuming square tiles)
>
> look right to you?
> cheers
> shoaib
>
>>
>> the maximum size of the tile cache for a given kaMap installation
>> could be calculated from:
>>
>> total = 0
>> for each map file
>> {
>>      for each scale
>>      {
>>          for each separate group in the map file
>>          {
>>               convert geographic extents to pixels at this scale
>>               divide width and height by tile width and height
>>               multiple number of tiles wide by high
>>               add to total
>>          }
>>      }
>> }
>>
>> Tile size on disk depends on output format generally, and also on
>> image complexity in compressed formats like PNG.  You'll probably
>> need to do a random sampling at each scale to get a good average
>>
>> Cheers
>>
>> Paul
>>
>> On 2-Feb-06, at 7:47 AM, Shoaib Burq wrote:
>>
>>> Hi
>>>
>>> I am trying to estimate the potential size of ka-map cache.
>>>
>>> Not so sure about the math to calculate the number of tiles given:
>>>
>>> 1. Area of the region
>>> 2. Raster Resolution
>>> 3. Tile Size
>>> 4. Num of Layers
>>>
>>> any suggestions?
>>>
>>> Also what's a good way to estimate the size of each tile on disk?
>>>
>>> thanks heaps
>>> shoaib
>>>
>>> _______________________________________________
>>> ka-Map-users mailing list
>>> ka-Map-users at lists.maptools.org
>>> http://lists.maptools.org/mailman/listinfo/ka-map-users
>>>
>>
>> +-----------------------------------------------------------------+
>> |Paul Spencer                           pspencer at dmsolutions.ca   |
>> +-----------------------------------------------------------------+
>> |Applications & Software Development                              |
>> |DM Solutions Group Inc                 http://www.dmsolutions.ca/|
>> +-----------------------------------------------------------------+
>>
>>
>>
>>
>>
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+






More information about the ka-Map-users mailing list