I am now able to do tilecache using TileCache1.3 from metacarta. Base from archives (archive-user.txt)

From crschmidt at metacarta.com  Wed Nov 22 17:54:29 2006
From: crschmidt at metacarta.com (Christopher Schmidt)
Date: Wed, 22 Nov 2006 17:54:29 -0500
Subject: [OpenLayers-Users] TileCache - Tiling issues
In-Reply-To: <4564D326.6020607@refractions.net>
References: <4564D326.6020607@refractions.net>
Message-ID: <20061122225429.GA18180@metacarta.com>
 
On Wed, Nov 22, 2006 at 02:45:58PM -0800, Ben Brehmer wrote:
> Hello everyone,
>
> I have setup a basic OpenLayers application with TileCache doing the
> server-side caching. I was wondering if there is a way to pre-cache all
> the tiles (besides panning/zooming everywhere on the map)? I know in
> kamap there is a script that can be run to pre-cache all the tiles. Is
> there something similair for TileCache?
 
In the TileCache directory, there is a 'Client.py' script. To pre-cache
your data, use it in the following manner:
 
python Client.py "http://example.com/tilecachelocation/tilecache.cgi?"
"layername" startzoomlevel endzoomlevel [BBOX]
 
Something like:
 
python Client.py "http://labs.metacarta.com/wms-c/Basic.py?" "basic" 0 16
 
Is what we used to precache all of the Vmap0 data in the MetaCarta VMap0
layer.
 
> Also, I have attached two jpegs. Each has part of a symbol or label
> chopped off. I believe that the "chopping" occurs at the edge of a tile.
> Has anyone ever experience something like this in OpenLayers?
 
This is based on your Mapserver setup, rather than something specific in
OpenLayers. Using WMS would result in the same visual result. Labels can
have this prevented using the "PARTIALS OFF" on your label layer, if
you're using Mapserver. I'm not aware of a way to prevent this in symbol
generation. 
 
We are currently working on ka-map style rendering to add to TileCache,
to help people not run into this issue. No timeframe available yet on
when that'll be released. 
 
Regards,
--
Christopher Schmidt
MetaCarta
  1. TileCache Configuration: tilecache.cfg
[cache]
type=DiskCache
base=E:\\usr\\local\\apache2\\htdocs\\tmp\\
 
[basemap]
type=WMSLayer
url=http://127.0.0.1/cgi-bin/mapserv.exe?map=/home/basemap/wmstest_longlat.map
layers=district,greens,major_river,minor_river
extension=png
 
[roads]
type=WMSLayer
url=http://127.0.0.1/cgi-bin/mapserv.exe?map=/home/basemap/wmstest_longlat.map
layers=road4,road4label,road3,road3label,road2,road2label,road1,road1label,road11,road11label
extension=png
  1. Calling CFM Script: Test.cfm
    <cfset request.mapserv="http://127.0.0.1/tilecache/tilecache.py"> 
 
    <script src="/OpenLayers-2.2/lib/OpenLayers.js"></script>
    <script type="text/javascript"></script>
        <!--<br /-->        //var lon = 116.3842;
        //var lat = 39.9150;
        var lon = 116.3846;
        var lat = 39.9202;
        var zoom = 16;
        var map, markers;
 
        function init(){
      	    map = new OpenLayers.Map( $('map'), { maxResolution: 'auto'});
 
	    var layer_base = new OpenLayers.Layer.WMS(
					"Base Layer",
					"#request.mapserv#",
					{
						layers: 'basemap',
						format: 'png', 'transparent': 'off'
					}
					);
 
                map.addLayer(layer_base);
	   layer_base.setIsBaseLayer(true);	
 
               ...more code here...
 
       }
</cfset>

I want to fine tune this script since I am getting odd tiles like duplicate tiles or tiles shown of different scale on the same scale.

  1. Precaching:
    /d/Python24/python.exe Client.py “http://127.0.0.1/tilecache/tilecache.py” “roads” 14 16 116.35397,39.88984,116.42988,39.91918

I need to understand the “cache hit” or “cache miss” during execution.