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

Stephen Woodbridge woodbri at swoodbridge.com
Fri Feb 3 11:10:53 EST 2006


Paul,

Someone DID write a tool to do this ... me. You can get it from
http://www.where2getit.com/mum3/

It is a Perl port of ka-map. In the precache.pl script I added a 
dryrun=1 parameter that allows it to calculate all the stats on the tile 
generation. I think I make some assumption on image size based on some 
tests I ran.

Feel free to back port the changes into the current CVS version.

<plug>
Where2getit will be making tiles available for commercial users in the 
future, contact the sales guys if you need more info on this.
</plug>

-Steve W.


Paul Spencer wrote:
> 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/|
> +-----------------------------------------------------------------+
> 
> 
> 
> 
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
> 



More information about the ka-Map-users mailing list