Tilecache Configuration

When you use the Astun 3rd Party installer to install Tilecache this will be installed to the following folder:

D:\Astun\Tools\Tilecache

Open the tilecache.cfg which you will find in the base folder.

[cache]

In the tilecache.cfg the cache base path must be the escaped full path to the location for tile images, e.g.:

cache
[cache]
type=Disk
base=d:\\TileCache\\Cache

Double backslashes are required for all paths in the tilecache.cfg file because backslashes are escape characters. 

[layer_name]

There will be a [layer_name] section for each basemap Map Source. In the following example this is called [base_standard]. For details of all of the configuration entries please refer to the TileCache documentation.

layer_name
[base_Standard]
type=WMS
url=http://localhost/cgi-bin5.2/mapserv?map=D:\\Maps\\Workshop\\_MapServerConfig\\base_Standard.map
extension=png
srs=EPSG:27700
layers=base_Standard
resolutions=72,38,25,16.6666076469763,8,5.29174706467881,3.52811834926054,2.11677453194175,1.05865549688159,0.5,0.25,0.125
bbox=429349, 558276, 442121, 569136
watermarkImage=D:\Astun\Workshop\Web\images\astun\watermark.png
watermarkOpacity=0.5

Type

This is the type of layer requested and will be WMS by default.

URL

The URL to use when requesting images from a remote WMS server. Required for WMSLayer. This tells you where to find the MapServer .map file that your basemap is using.

Layers

The Layer or Layer Group in the MapServer .map file used to generate the cache.

Resolutions

A comma separated set of resolutions automatically calculated from the zoom levels set in iShare. Layers must share the same array of resolutions as the layer defined in the OpenLayers layer definition.

Levels

A set of Zoom levels automatically generated for iShare Studio (overridden by resolutions if present).

Extension

The image format to be requested from MapServer

SRS

The projection or coordinate reference system of the layer. Default is “EPSG:4326”

BBOX

The bounding box of the TileCache, automatically generated from iShare Studio and must use the same bounding box as defined in the .map file. The resolutions array defaults to having resolutions which are equal to the bbox divided by 512 (two standard tiles).

WatermarkImage

The location of a watermark image to include on every tile in the cache. This is a fully qualified path to an image. We recommend you use a watermark image the same size as your tiles. If using the default tile size, you should use a 256x256 image. 

Python Imaging Library DOES NOT support interlaced images.

A watermark is required for OS derived images.

WatermarkOpacity

This parameter is assigned on a per-layer basis. This configures the opacity of the watermark over the tile, it is a floating point number between 0 and 1. Usage is optional and will otherwise default.

MetaBuffer

An integer number of pixels to request around each tile. This combats “edge effects” where labels appear to be cut off at the edge of tiles. This is not set in Studio and can be set to any integer value; we recommend 100-150.

MetaTile

Use of 'metaTile is recommended as it increases the speed of seeding the Tilecache. True/False (default = False). If True, requests larger tiles and then splits them up, if the Python Imaging Library is installed. This is not set by Studio and will cause errors if set at the lower zoom levels (e.g. larger scale), but can drastically shorten the time required to seed the cache if set for higher zoom levels.

Be aware that this option requires you to have the Python Imaging library installed on your python instance.