# Tile cache

**URL:** <https://community.thinkgeo.com/t/tile-cache/3340>\
**Category:** WPF\
**Created:** [December 7, 2012, 11:59am UTC](https://community.thinkgeo.com/t/tile-cache/3340 "2012-12-07T11:59:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steph](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Steph](https://community.thinkgeo.com/u/Steph)\
**Post date:** [December 7, 2012, 11:59am UTC](https://community.thinkgeo.com/t/tile-cache/3340/1 "2012-12-07T11:59:10Z")

</div>

&nbsp;Hi,&nbsp;

&nbsp;  
I&nbsp;have&nbsp;question&nbsp;about&nbsp;the&nbsp;tilecache.  
We&nbsp;use&nbsp;rasters&nbsp;ecw&nbsp;;&nbsp;tif&nbsp;...&nbsp;and&nbsp;the&nbsp;multigeorasterLayer&nbsp;class.  
When&nbsp;I&nbsp;zoom&nbsp;or&nbsp;pan,&nbsp;it's&nbsp;slow&nbsp;and&nbsp;i&nbsp;don't&nbsp;know&nbsp;how&nbsp;to&nbsp;optimize&nbsp;the&nbsp;system.  
&nbsp;  
&nbsp;  
1)&nbsp;Rasters&nbsp;appears&nbsp;from&nbsp;a&nbsp;certain&nbsp;threshold&nbsp;of&nbsp;zoom&nbsp;and&nbsp;the&nbsp;cache&nbsp;is&nbsp;defined&nbsp;like&nbsp;that&nbsp;:&nbsp;  
&nbsp;&nbsp;  
2)&nbsp;ovLy.TileCache&nbsp;=&nbsp;new&nbsp;FileBitmapTileCache(pathCache,&nbsp;"ManualCache");  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ovLy.TileHeight&nbsp;=&nbsp;1024;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ovLy.TileWidth&nbsp;=&nbsp;1024;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ovLy.TileType&nbsp;=&nbsp;TileType.HybridTile;  
&nbsp;  
What&nbsp;is&nbsp;the&nbsp;better&nbsp;way&nbsp;to&nbsp;define&nbsp;a&nbsp;cache&nbsp;?  
In&nbsp;the&nbsp;directory&nbsp;"ManualCache",&nbsp;there&nbsp;are&nbsp;severals&nbsp;directorys&nbsp;like&nbsp;ie&nbsp;file&nbsp;attached&nbsp;  
&nbsp;  
What&nbsp;means&nbsp;exactly&nbsp;?  
&nbsp;  
Thanks&nbsp;a&nbsp;lot.  
&nbsp;  
Regards.  
&nbsp;  
Steph.

---

<div class="post-metadata">

**Author:** ![Ryan](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@Ryan](https://community.thinkgeo.com/u/Ryan)\
**Post date:** [December 10, 2012, 5:28pm UTC](https://community.thinkgeo.com/t/tile-cache/3340/2 "2012-12-10T17:28:26Z")

</div>

Hi&nbsp;Steph,

Thanks&nbsp;for&nbsp;your&nbsp;question!

Once&nbsp;you&nbsp;populate&nbsp;the&nbsp;TileCache&nbsp;for&nbsp;this&nbsp;data&nbsp;it&nbsp;should&nbsp;load&nbsp;more&nbsp;quickly&nbsp;than&nbsp;if&nbsp;it&nbsp;is&nbsp;reading&nbsp;from&nbsp;the&nbsp;main&nbsp;datasource,&nbsp;but&nbsp;it&nbsp;will&nbsp;only&nbsp;be&nbsp;faster&nbsp;after&nbsp;it&nbsp;populates&nbsp;the&nbsp;TileCache.&nbsp;The&nbsp;first&nbsp;time&nbsp;you&nbsp;pan/zoom&nbsp;to&nbsp;an&nbsp;area&nbsp;the&nbsp;Map&nbsp;reads&nbsp;the&nbsp;source&nbsp;data&nbsp;to&nbsp;create&nbsp;the&nbsp;tiles&nbsp;that&nbsp;exist&nbsp;in&nbsp;the&nbsp;tile&nbsp;cache&nbsp;and&nbsp;if&nbsp;you&nbsp;have&nbsp;very&nbsp;detailed&nbsp;data&nbsp;the&nbsp;generation&nbsp;of&nbsp;these&nbsp;tiles&nbsp;could&nbsp;take&nbsp;a&nbsp;bit.

The&nbsp;directories&nbsp;created&nbsp;under&nbsp;your&nbsp;'ManualCache'&nbsp;folder&nbsp;are&nbsp;named&nbsp;using&nbsp;the&nbsp;different&nbsp;scales&nbsp;for&nbsp;each&nbsp;ZoomLevel&nbsp;in&nbsp;the&nbsp;Map's&nbsp;ZoomLevelSet.&nbsp;If&nbsp;you&nbsp;are&nbsp;using&nbsp;the&nbsp;DefaultZoomLevelSet&nbsp;you&nbsp;should&nbsp;get&nbsp;20&nbsp;folders&nbsp;after&nbsp;you&nbsp;ZoomIn/Out&nbsp;to&nbsp;each&nbsp;of&nbsp;the&nbsp;ZoomLevels:

 ![](https://community.thinkgeo.com/uploads/default/original/2X/d/d0cce167dc81835d1e0c57f6433e10187e54586f.gif)

---

<div class="post-metadata">

**Author:** ![Steph](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Steph](https://community.thinkgeo.com/u/Steph)\
**Post date:** [December 13, 2012, 7:45am UTC](https://community.thinkgeo.com/t/tile-cache/3340/3 "2012-12-13T07:45:14Z")

</div>

Hi&nbsp;Ryan,&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Steph.

---

<div class="post-metadata">

**Author:** ![Ryan](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@Ryan](https://community.thinkgeo.com/u/Ryan)\
**Post date:** [December 13, 2012, 10:52am UTC](https://community.thinkgeo.com/t/tile-cache/3340/4 "2012-12-13T10:52:54Z")

</div>

Glad&nbsp;to&nbsp;be&nbsp;of&nbsp;assistance!&nbsp;Let&nbsp;us&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;additional&nbsp;questions.

---

<div class="post-metadata">

**Author:** ![Steph](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Steph](https://community.thinkgeo.com/u/Steph)\
**Post date:** [January 14, 2013, 4:32am UTC](https://community.thinkgeo.com/t/tile-cache/3340/5 "2013-01-14T04:32:56Z")

</div>

&nbsp;Hi&nbsp;Ryan,&nbsp;

I&nbsp;had&nbsp;just&nbsp;one&nbsp;more&nbsp;question&nbsp;about&nbsp;tile&nbsp;cache.&nbsp;

The&nbsp;name&nbsp;of&nbsp;the&nbsp;directory&nbsp;on&nbsp;the&nbsp;left&nbsp;side&nbsp;depends&nbsp;on&nbsp;the&nbsp;zoomLevel&nbsp;(equal&nbsp;to&nbsp;the&nbsp;scaleValue).

But&nbsp;the&nbsp;name&nbsp;of&nbsp;the&nbsp;directory&nbsp;on&nbsp;the&nbsp;right&nbsp;side&nbsp;as&nbsp; **21922&nbsp;;&nbsp;21924&nbsp;&nbsp;;&nbsp;....&nbsp;** and&nbsp;the&nbsp;name&nbsp;of&nbsp;the&nbsp;png&nbsp;file&nbsp;**(268071.png&nbsp;;&nbsp;268073.png&nbsp;;&nbsp;...)**&nbsp;are&nbsp;automatic&nbsp;?&nbsp;Or&nbsp;is&nbsp;there&nbsp;a&nbsp;logic&nbsp;?

Thanks&nbsp;a&nbsp;lot&nbsp;for&nbsp;your&nbsp;help

Regards.

Steph.

&nbsp; ![](https://community.thinkgeo.com/uploads/default/original/2X/8/8e989530678923c9f06c3727e4a6ef8003026b8b.PNG)

&nbsp;

 ![](https://community.thinkgeo.com/uploads/default/original/2X/b/b044a08e802fbefcbc55086fc24a4666e889a462.PNG)

---

<div class="post-metadata">

**Author:** ![Ryan](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@Ryan](https://community.thinkgeo.com/u/Ryan)\
**Post date:** [January 14, 2013, 4:23pm UTC](https://community.thinkgeo.com/t/tile-cache/3340/6 "2013-01-14T16:23:51Z")

</div>

Hi&nbsp;Steph,&nbsp;  
  
The&nbsp;TileCache&nbsp;uses&nbsp;a&nbsp;TileMatrix&nbsp;object&nbsp;to&nbsp;split&nbsp;up&nbsp;the&nbsp;data&nbsp;and&nbsp;name&nbsp;it&nbsp;appropriately.&nbsp;You&nbsp;can&nbsp;check&nbsp;out&nbsp;the&nbsp;details&nbsp;of&nbsp;the&nbsp;TileMatrix&nbsp;used&nbsp;in&nbsp;your&nbsp;TileCache&nbsp;by&nbsp;simply&nbsp;checking&nbsp;out&nbsp;the&nbsp;API&nbsp;structure&nbsp;here:&nbsp;[wiki.thinkgeo.com/wiki/Think...TileMatrix](http://wiki.thinkgeo.com/wiki/ThinkGeo.MapSuite.Core.TileMatrix)

---

<div class="post-metadata">

**Author:** ![Steph](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Steph](https://community.thinkgeo.com/u/Steph)\
**Post date:** [January 15, 2013, 10:08am UTC](https://community.thinkgeo.com/t/tile-cache/3340/7 "2013-01-15T10:08:49Z")

</div>

Hi&nbsp;Ryan,&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Steph.

---

<div class="post-metadata">

**Author:** ![Ryan](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@Ryan](https://community.thinkgeo.com/u/Ryan)\
**Post date:** [January 15, 2013, 2:00pm UTC](https://community.thinkgeo.com/t/tile-cache/3340/8 "2013-01-15T14:00:18Z")

</div>

You&nbsp;are&nbsp;welcome!
