This file is indexed.

/usr/share/doc/tilecache/html/README.html is in tilecache 2.11-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Getting Started &mdash; TileCache v2.11 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '2.11',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="TileCache v2.11 documentation" href="index.html" />
    <link rel="next" title="TileCache Caches" href="Caches.html" />
    <link rel="prev" title="Welcome to TileCache’s documentation!" href="index.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="Caches.html" title="TileCache Caches"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Welcome to TileCache’s documentation!"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">TileCache v2.11 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="getting-started">
<h1>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline"></a></h1>
<div class="section" id="cache-and-serve-map-tiles">
<h2>Cache and serve map tiles<a class="headerlink" href="#cache-and-serve-map-tiles" title="Permalink to this headline"></a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Author:</th><td class="field-body"><a class="reference external" href="mailto:labs&#37;&#52;&#48;metacarta&#46;com">labs<span>&#64;</span>metacarta<span>&#46;</span>com</a></td>
</tr>
<tr class="field"><th class="field-name">Copyright:</th><td class="field-body">(c) 2006-2010 TileCache Contributors
Distributed under the BSD license.</td>
</tr>
<tr class="field"><th class="field-name">Version:</th><td class="field-body">2.11</td>
</tr>
<tr class="field"><th class="field-name">Manual section:</th><td class="field-body">8</td>
</tr>
<tr class="field"><th class="field-name">Manual group:</th><td class="field-body">GIS Utilities</td>
</tr>
</tbody>
</table>
<div class="section" id="description">
<h3>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h3>
<p>TileCache is a BSD licensed tile caching mechanism.  The goal is to make it
easy to set up a WMS or TMS frontend to any backend data services you might be
interested in, using a pluggable caching and rendering mechanism.</p>
<p>TileCache was developed by MetaCarta Labs and released to the public under a
BSD license.</p>
<p>The TileCache was designed as a companion to OpenLayers, the BSD licensed web
mapping interface. If you are using TileCache with OpenLayers, please read the
section of this readme which describes how to do so. For additional help with
setting up TileCache for use with OpenLayers, please feel free to stop by
#openlayers, on irc.freenode.net, or to send email to
<a class="reference external" href="mailto:tilecache&#37;&#52;&#48;openlayers&#46;org">tilecache<span>&#64;</span>openlayers<span>&#46;</span>org</a>.</p>
</div>
<div class="section" id="installing-tilecache">
<h3>Installing TileCache<a class="headerlink" href="#installing-tilecache" title="Permalink to this headline"></a></h3>
<p>Generally, installing TileCache is as simple as downloading a source
distribution and unpacking it. For installation systemwide, you can also use
the Python Package Index (aka pypi or Cheeseshop) to install TileCache. Simply
type easy_install TileCache. Once this is done, you will need to install the
TileCache configuration file. A tool to do this is installed, called
tilecache_install_config.py. A full installation likely looks like:</p>
<div class="highlight-python"><pre>$ sudo easy_install TileCache
...
Installed
/usr/lib/python2.5/site-packages/TileCache-2.10-py2.5.egg

$ sudo tilecache_install_config.py
Successfully copied file
/usr/lib/python2.5/site-packages/TileCache-2.10-py2.5.egg/TileCache/tilecache.cfg
to /etc/tilecache.cfg.</pre>
</div>
<p>TileCache is also available as a Debian package from the TileCache homepage.
This Debian package is designed to install on Debian etch releases or later.
This Debian package should install on Ubuntu Feisty or Gutsy.</p>
</div>
<div class="section" id="running-under-cgi">
<h3>Running Under CGI<a class="headerlink" href="#running-under-cgi" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">Extract the code to some web directory (e.g. in /var/www).</p>
</li>
<li><p class="first">Edit tilecache.cfg to point the DiskCache to the location you wish
to cache tiles, and the layers to point to the map file or WMS
server you wish to cache. On Debian, this file is in /etc/tilecache.cfg
by default.</p>
</li>
<li><p class="first">Permit CGI execution in the TileCache directory.
For example, if TileCache is to be run with Apache, the
following must be added in your Apache configuration,
where /var/www/tilecache is the directory resulting from
the code extraction. On Debian, this is typically /usr/lib/cgi-bin.</p>
<div class="highlight-python"><pre>&lt;Directory /var/www/tilecache&gt;
     AddHandler cgi-script .cgi
     Options +ExecCGI
&lt;/Directory&gt;</pre>
</div>
</li>
<li><p class="first">Visit:</p>
<p><a class="reference external" href="http://example.com/yourdir/tilecache.cgi?LAYERS=basic&amp;SERVICE=WMS">http://example.com/yourdir/tilecache.cgi?LAYERS=basic&amp;SERVICE=WMS</a>
&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;SRS=EPSG:4326&amp;BBOX=-180,-90,0,90
&amp;WIDTH=256&amp;HEIGHT=256</p>
</li>
<li><p class="first">Or visit:</p>
<p><a class="reference external" href="http://example.com/yourdir/tilecache.cgi/1.0.0/basic/0/0/0.png">http://example.com/yourdir/tilecache.cgi/1.0.0/basic/0/0/0.png</a></p>
</li>
<li><p class="first">If you see a tile you have set up your configuration correctly. Congrats!</p>
</li>
</ul>
<div class="section" id="non-standard-python-location">
<h4>Non-standard Python Location<a class="headerlink" href="#non-standard-python-location" title="Permalink to this headline"></a></h4>
<p>If your Python is not at /usr/bin/python on your system, you will need to
change the first line of tilecache.cgi to reference the location of your Python
binary. A common example is:</p>
<blockquote>
<div><div class="highlight-python"><div class="highlight"><pre><span class="c">#!/usr/local/bin/python</span>
</pre></div>
</div>
</div></blockquote>
<p>Under Apache, you might see an error message like:</p>
<blockquote>
<div><div class="highlight-python"><pre>[Wed Mar 14 19:55:30 2007] [error] [client 127.0.0.1] (2)No such file or
  directory: exec of '/www/tilecache.cgi' failed</pre>
</div>
</div></blockquote>
<p>to indicate this problem.</p>
<p>You can typically locate where Python is installed on your system via the
command which python.</p>
<p>Windows users: If you are using Windows, you should change the first line
of tilecache.cgi to read:</p>
<blockquote>
<div><div class="highlight-python"><div class="highlight"><pre><span class="c">#!C:/Python/python.exe -u</span>
</pre></div>
</div>
</div></blockquote>
<p>C:/Python should match the location Python is installed under on your
system. In Python 2.5, this location is C:/Python25 by default.</p>
</div>
</div>
<div class="section" id="running-under-mod-python">
<h3>Running Under mod_python<a class="headerlink" href="#running-under-mod-python" title="Permalink to this headline"></a></h3>
<ul>
<li><p class="first">Extract the code to some web directory (e.g. /var/www).</p>
</li>
<li><p class="first">Edit tilecache.cfg to point the DiskCache to the location you wish
to cache tiles, and the layers to point to the map file or WMS
server you wish to cache</p>
</li>
<li><p class="first">Add the following to your Apache configuration, under a &lt;Directory&gt; heading:</p>
<div class="highlight-python"><pre>AddHandler python-program .py
PythonHandler TileCache.Service
PythonOption TileCacheConfig /path/to/tilecache.cfg</pre>
</div>
</li>
<li><p class="first">An example might look like:</p>
<div class="highlight-python"><pre>&lt;Directory /var/www/tilecache/&gt;
    AddHandler python-program .py
    PythonHandler TileCache.Service
    PythonOption TileCacheConfig /var/www/tilecache/tilecache.cfg
&lt;/Directory&gt;</pre>
</div>
</li>
<li><p class="first">In this example, /var/www/tilecache is the directory resulting from
the code extraction. If you&#8217;ve installed this from a Debian package, the
location of your .cfg file is probably /etc/tilecache.cfg.</p>
</li>
<li><p class="first">Edit tilecache.cfg to point to the location of your &#8216;Layers&#8217; directory,
as demonstrated inside the default tilecache.cfg.</p>
</li>
<li><p class="first">Visit one of the URLs described above, replacing tilecache.cgi with
tilecache.py</p>
</li>
<li><p class="first">If you see a tile you have set up your configuration correctly. Congrats!</p>
</li>
</ul>
</div>
<div class="section" id="running-standalone-under-wsgi">
<h3>Running Standalone under WSGI<a class="headerlink" href="#running-standalone-under-wsgi" title="Permalink to this headline"></a></h3>
<p>TileCache as of version 1.4 comes with a standalone HTTP server which uses
the WSGI handler. This implementation depends on <em>Python Paste</em>, which can be
downloaded from:</p>
<blockquote>
<div><a class="reference external" href="http://cheeseshop.python.org/pypi/Paste">http://cheeseshop.python.org/pypi/Paste</a></div></blockquote>
<p>For versions of Python earlier than 2.5, you will also need to install
wsgiref:</p>
<blockquote>
<div><a class="reference external" href="http://cheeseshop.python.org/pypi/wsgiref">http://cheeseshop.python.org/pypi/wsgiref</a></div></blockquote>
<p>Once you have all the prerequisites installed, simply run:</p>
<blockquote>
<div><div class="highlight-python"><pre>python tilecache_http_server.py</pre>
</div>
</div></blockquote>
<p>This will start a webserver listening on port 8080, after which you should
be able to open:</p>
<blockquote>
<div><div class="highlight-python"><pre>http://hostname:8080/1.0.0/basic/0/0/0.png</pre>
</div>
</div></blockquote>
<p>to see your first tile.</p>
</div>
<div class="section" id="running-under-fastcgi">
<h3>Running Under FastCGI<a class="headerlink" href="#running-under-fastcgi" title="Permalink to this headline"></a></h3>
<p>TileCache as of version 1.4 comes with a fastcgi implementation. In
order to use this implementation, you will need to install flup, available
from:</p>
<blockquote>
<div><a class="reference external" href="http://trac.saddi.com/flup">http://trac.saddi.com/flup</a></div></blockquote>
<p>This implementation also depends on Python Paste, which can be downloaded
from:</p>
<blockquote>
<div><a class="reference external" href="http://cheeseshop.python.org/pypi/Paste">http://cheeseshop.python.org/pypi/Paste</a></div></blockquote>
<p>Once you have done this, you can configure your fastcgi server to use
tilecache.fcgi.</p>
<p>Configuring FastCGI is beyond the scope of this documentation.</p>
</div>
<div class="section" id="running-under-iis">
<h3>Running Under IIS<a class="headerlink" href="#running-under-iis" title="Permalink to this headline"></a></h3>
<p>Installing TileCache for use with IIS requires some additional configuration.</p>
<p>A nice document for setting up TileCache on IIS is available from Vish&#8217;s
weblog: <a class="reference external" href="http://viswaug.wordpress.com/2008/02/03/setting-up-tilecache-on-iis/">http://viswaug.wordpress.com/2008/02/03/setting-up-tilecache-on-iis/</a> .</p>
</div>
<div class="section" id="running-standalone-with-pastescript-and-cherrypy">
<h3>Running Standalone with PasteScript and CherryPy<a class="headerlink" href="#running-standalone-with-pastescript-and-cherrypy" title="Permalink to this headline"></a></h3>
<p>One component of the CherryPy web framework is a pure Python, fast,
HTTP/1.1-compliant, WSGI thread-pooled webserver.
To deploy Tilecache using this option you have to:</p>
<blockquote>
<div><ul>
<li><p class="first">Install prerequisites:</p>
<blockquote>
<div><p>easy_install PasteScript
easy_install CherryPy</p>
</div></blockquote>
</li>
<li><p class="first">Create a deployment config file specifying the http server and the
application with options.  The format of the configuration file is
documented here: <a class="reference external" href="http://pythonpaste.org/deploy/#the-config-file">http://pythonpaste.org/deploy/#the-config-file</a></p>
</li>
</ul>
</div></blockquote>
<p>Example configuration file follows. Copy the lines into tc.ini, tweak
the tilecache_config variable, run paster serve tc.ini and enjoy at
<a class="reference external" href="http://127.0.0.1:5000/tc">http://127.0.0.1:5000/tc</a></p>
<div class="highlight-python"><pre>[server:main]
#tested with Paste#http and PasteScript#wsgiutils, PasteScript#twisted
also possible after installing dependencies
use = egg:PasteScript#cherrypy
host = 127.0.0.1
port = 5000

[composite:main]
use = egg:Paste#urlmap
/tc = tilecache1

[app:tilecache1]
use = egg:TileCache
tilecache_config = tilecache.cfg</pre>
</div>
</div>
<div class="section" id="configuration">
<h3>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline"></a></h3>
<p>TileCache is configured by a config file, defaulting to tilecache.cfg.
There are several parameters to control TileCache layers that are applicable
to all layers:</p>
<blockquote>
<div><dl class="docutils">
<dt>bbox</dt>
<dd>The bounding box of the Layer. The resolutions array defaults
to having resolutions which are equal to the bbox divided by
512 (two standard tiles).</dd>
<dt>debug</dt>
<dd>Whether to send debug output to the error.log. Defaults to &#8220;yes&#8221;,
can be set to &#8220;no&#8221;</dd>
<dt>description</dt>
<dd>Layer description, used in some metadata responses. Default
is blank.</dd>
<dt>extension</dt>
<dd>File extension of the layer. Used to request images from
WMS servers, as well as when writing cache files.</dd>
<dt>layers</dt>
<dd>A string used to describe the layers. Typically passed directly
to the renderer. The WMSLayer sends this in the HTTP request,
and the MapServerLayer chooses which layer to render based on
this string. If no layer is provided, the layer name is used
to fill this property.</dd>
<dt>levels</dt>
<dd>An integer, describing the number of &#8216;zoom levels&#8217; or
scales to support. Overridden by resolutions, if passed.</dd>
<dt>mapfile</dt>
<dd>The absolute file location of a mapfile. Required for
MapServer and Mapnik layers.</dd>
<dt>maxResolution</dt>
<dd>The maximum resolution. If this is set, a resolutions
array is automatically calculated up to a number of
levels controlled by the &#8216;levels&#8217; option.</dd>
<dt>metaTile</dt>
<dd>set to &#8220;yes&#8221; to turn on metaTiling. This will request larger
tiles, and split them up using the Python Imaging library.
Defaults to &#8220;no&#8221;.</dd>
<dt>metaBuffer</dt>
<dd>an integer number of pixels to request around the outside
of the rendered tile. This is good to combat edge effects
in various map renderers. Defaults to 10.</dd>
<dt>metaSize</dt>
<dd>A comma seperated pair of integers, which is used to
determine how many tiles should be rendered when using
metaTiling. Default is 5,5.</dd>
<dt>resolutions</dt>
<dd>Comma seperate list of resolutions you want the TileCache
instance to support.</dd>
<dt>size</dt>
<dd>Comma seperated set of integers, describing the width/height
of the tiles. Defaults to 256,256</dd>
<dt>srs</dt>
<dd>String describing the SRS value. Default is &#8220;EPSG:4326&#8221;</dd>
<dt>type</dt>
<dd>The type of layer. Options are: WMSLayer, MapnikLayer, MapServerLayer,
ImageLayer</dd>
<dt>url</dt>
<dd>URL to use when requesting images from a remote WMS server. Required
for WMSLayer.</dd>
<dt>watermarkImage</dt>
<dd>The watermarkImage parameter is assigned on a per-layer basis.
This is a fully qualified path to an image you would like to apply to each
tile. 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.
NOTE: Python Imaging Library DOES NOT support interlaced images.</dd>
<dt>watermarkOpacity</dt>
<dd>The watermarkOpacity 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.</dd>
<dt>extent_type</dt>
<dd>Setting this to &#8216;loose&#8217; will allow TileCache to generate tiles outside the
maximum bounding box. Useful for clients that don&#8217;t know when to stop
asking for tiles.</dd>
<dt>tms_type</dt>
<dd>Setting this to &#8220;google&#8221; will cause tiles to switch vertical order (that
is, following the Google style x/y pattern).</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="using-tilecache-with-openlayers">
<h3>Using TileCache With OpenLayers<a class="headerlink" href="#using-tilecache-with-openlayers" title="Permalink to this headline"></a></h3>
<p>To run OpenLayers with TileCache the URL passed to the OpenLayers.Layer.WMS
constructor must point to the TileCache script, i.e. tilecache.cgi or
tilecache.py. As an example see the index.html file included in the TileCache
distribution.</p>
<p>Note: index.html assumes TileCache is set up under CGI (see above). If you set
up TileCache under mod_python you&#8217;d need to slighly modify index.html: the URL
passed to the OpenLayers.Layer.WMS constructor must point to the mod_python
script as opposed to the CGI script, so replace tilecache.cgi with
tilecache.py. Similarly, you would need to edit this URL if you were to use
TileCache with the standalone HTTP Server or FastCGI.</p>
<p>The most important thing to do is to ensure that the OpenLayers Layer
has the same resolutions and bounding box as your TileCache layer. You can define
the resolutions in OpenLayers via the &#8216;resolutions&#8217; option or the &#8216;maxResolution&#8217;
option on the layer. The maxExtent should be defined to match the bbox parameter
of the TileCache layer.</p>
<p>If you are using TileCache for overlays, you should set the &#8216;reproject&#8217; option
on the layer to &#8216;false&#8217;.</p>
</div>
<div class="section" id="using-tilecache-with-mapserver">
<h3>Using TileCache With MapServer<a class="headerlink" href="#using-tilecache-with-mapserver" title="Permalink to this headline"></a></h3>
<p>MapServer has a map level metadata option, labelcache_map_edge_buffer, which
is set automatically by TileCache to the metaBuffer plus five when metaTiling
is on, if it is not set in the mapfile.</p>
<p>If you are using MetaTiling, be aware that MapServer generates interlaced
PNG files, which PIL will not read. See
<a class="reference external" href="http://www.mapserver.org/faq.html#why-doesn-t-pil-python-imaging-library-open-my-pngs">http://www.mapserver.org/faq.html#why-doesn-t-pil-python-imaging-library-open-my-pngs</a> on how to resolve this.</p>
</div>
<div class="section" id="using-with-python-mapscript">
<h3>Using With Python-Mapscript<a class="headerlink" href="#using-with-python-mapscript" title="Permalink to this headline"></a></h3>
<p>Several users have reported cases where large mapfiles combined with
python-mapscript has caused memory leaks, which eventually lead to
segfaults. If you are having problems with Apache/TileCache segfaults
when using python-mapscript, then you should switch to using a WMS
Layer instead of a MapServer Layer.</p>
</div>
<div class="section" id="seeding-your-tilecache">
<h3>Seeding your TileCache<a class="headerlink" href="#seeding-your-tilecache" title="Permalink to this headline"></a></h3>
<p>The tilecache_seed.py utility will seed tiles in a cache automatically. You will
need to have TileCache set up in one of the previously described configurations.</p>
<div class="section" id="usage">
<h4>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h4>
<blockquote>
<div>tilecache_seed.py [options] &lt;layer&gt; [&lt;zoom start&gt; &lt;zoom stop&gt;]</div></blockquote>
</div>
<div class="section" id="options">
<h4>Options<a class="headerlink" href="#options" title="Permalink to this headline"></a></h4>
<blockquote>
<div><table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--version</span></kbd></td>
<td>show program&#8217;s version number and exit</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></td>
<td>show this help message and exit</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force recreation of tiles even if they are already in
cache</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-b <var>BBOX</var></span>, <span class="option">--bbox=<var>BBOX</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>restrict to specified bounding box</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-p <var>PADDING</var></span>, <span class="option">--pading=<var>PADDING</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>extra margin tiles to seed around target area.
Defaults to 0 (some edge tiles might be missing).
A value of 1 ensures all tiles will be created, but
some tiles may be wholly outside your bbox</td></tr>
</tbody>
</table>
</div></blockquote>
</div>
<div class="section" id="arguments">
<h4>Arguments<a class="headerlink" href="#arguments" title="Permalink to this headline"></a></h4>
<blockquote>
<div><dl class="docutils">
<dt>layer</dt>
<dd>same layer name that is in the tilecache.cfg</dd>
<dt>zoom start</dt>
<dd>Zoom level to start the process</dd>
<dt>zoom end</dt>
<dd>Zoom level to end the process</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="seeding-by-center-point-and-radius">
<h4>Seeding by center point and radius<a class="headerlink" href="#seeding-by-center-point-and-radius" title="Permalink to this headline"></a></h4>
<p>If called without zoom level arguments, tilecache_seed.py will assume
that it needs to read a list of points and radii from standard input,
in the form:</p>
<blockquote>
<div><div class="highlight-python"><pre>&lt;lat&gt;,&lt;lon&gt;,&lt;radius&gt;
&lt;lat&gt;,&lt;lon&gt;,&lt;radius&gt;
&lt;lat&gt;,&lt;lon&gt;,&lt;radius&gt;
&lt;lat&gt;,&lt;lon&gt;,&lt;radius&gt;
&lt;ctrl + d&gt;</pre>
</div>
</div></blockquote>
<p>The format of this file is:</p>
<blockquote>
<div><dl class="docutils">
<dt>lon</dt>
<dd>the position(s) to seed longitude</dd>
<dt>lat</dt>
<dd>the position(s) to seed latitude</dd>
<dt>radius</dt>
<dd>the radius around the lon/lat to seed in degrees</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="examples">
<h4>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h4>
<p>An example with zoom levels 5 through 12 and ~2 extra tiles around each zoom level would be like:</p>
<blockquote>
<div><div class="highlight-python"><pre>$ tilecache_seed.py Zip_Codes 5 12 "-118.12500,31.952162238,-116.015625,34.3071438563" 2</pre>
</div>
</div></blockquote>
<p>The bbox can be dropped and defaults to world lonlat(-180,-90,180,90):</p>
<blockquote>
<div><div class="highlight-python"><pre>$ tilecache_seed.py Zip_Codes 0 9</pre>
</div>
</div></blockquote>
<p>In center point/radius mode, the zoom level range is not specifiable from the
command-line. An example usage might look like:</p>
<blockquote>
<div><div class="highlight-python"><pre>$ tilecache_seed.py Zip_Codes
-118.12500,31.952162238,0.05
-121.46327,32.345345645,0.08
&lt;Ctrl+D&gt;</pre>
</div>
</div></blockquote>
<p>... the seeding will then commence ...</p>
</div>
</div>
<div class="section" id="cleaning-your-tilecache">
<h3>Cleaning your TileCache<a class="headerlink" href="#cleaning-your-tilecache" title="Permalink to this headline"></a></h3>
<p>The tilecache_clean.py utility will remove the least recently accessed
tiles from a cache, down to a specified size.</p>
<div class="section" id="id1">
<h4>Usage<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h4>
<blockquote>
<div>tilecache_clean.py [options] &lt;cache_location&gt;</div></blockquote>
</div>
<div class="section" id="id2">
<h4>Options<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h4>
<blockquote>
<div><table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--version</span></kbd></td>
<td>show program&#8217;s version number and exit</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></td>
<td>show this help message and exit</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s <var>SIZE</var></span>, <span class="option">--size=<var>SIZE</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>Maximum cache size, in megabytes.</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-e <var>ENTRIES</var></span>, <span class="option">--entries=<var>ENTRIES</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>Maximum cache entries. This limits the
amount of memory that will be used to store
information about tiles to remove.</td></tr>
</tbody>
</table>
</div></blockquote>
</div>
<div class="section" id="notes">
<h4>Notes<a class="headerlink" href="#notes" title="Permalink to this headline"></a></h4>
<p>The &#8211;entries option to tilecache_clean.py is optional, and is used to regulate
how much memory it uses to do its bookkeeping. The default value of 1 million
will hopefully keep RAM utilization under about 100M on a 32-bit x86 Linux
machine. If tilecache_clean.py doesn&#8217;t appear to be keeping your disk cache
down to an appropriate size, try upping this value.</p>
<p>tilecache_clean.py is designed to be run from a cronjob like so:</p>
<blockquote>
<div><div class="highlight-python"><pre>00 05 * * *  /usr/local/bin/tilecache_clean.py -s500 /var/www/tilecache</pre>
</div>
</div></blockquote>
<p>Note that, on non-POSIX operating systems (particularly Windows),
tilecache_clean.py measures file sizes, and not disk usage. Because most
filesystems use entire file blocks for files smaller than a block, running du
-s or similar on your disk cache after a cleaning may still return a total
cache size larger than you expect.</p>
</div>
</div>
<div class="section" id="troubleshooting">
<h3>TroubleShooting<a class="headerlink" href="#troubleshooting" title="Permalink to this headline"></a></h3>
<p>Occasionally, for some reason, when using meta tiles, your server may leave
behind lock files. If this happens, there will be files in your cache directory
with the extension &#8216;.lck&#8217;. If you are seeing tiles not render and taking
multiple minutes before returning a 500 error, you may be suffering under
a stuck lock.</p>
<p>Removing all files with extension &#8216;.lck&#8217; from the cache directory will
resolve this problem.</p>
</div>
<div class="section" id="see-also">
<h3>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline"></a></h3>
<p>memcached(8)</p>
<p><a class="reference external" href="http://tilecache.org/">http://tilecache.org/</a></p>
<p><a class="reference external" href="http://openlayers.org/">http://openlayers.org/</a></p>
<p><a class="reference external" href="http://wiki.osgeo.org/index.php/WMS_Tiling_Client_Recommendation">http://wiki.osgeo.org/index.php/WMS_Tiling_Client_Recommendation</a></p>
<p><a class="reference external" href="http://wiki.osgeo.org/index.php/Tile_Map_Service_Specification">http://wiki.osgeo.org/index.php/Tile_Map_Service_Specification</a></p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Getting Started</a><ul>
<li><a class="reference internal" href="#cache-and-serve-map-tiles">Cache and serve map tiles</a><ul>
<li><a class="reference internal" href="#description">Description</a></li>
<li><a class="reference internal" href="#installing-tilecache">Installing TileCache</a></li>
<li><a class="reference internal" href="#running-under-cgi">Running Under CGI</a><ul>
<li><a class="reference internal" href="#non-standard-python-location">Non-standard Python Location</a></li>
</ul>
</li>
<li><a class="reference internal" href="#running-under-mod-python">Running Under mod_python</a></li>
<li><a class="reference internal" href="#running-standalone-under-wsgi">Running Standalone under WSGI</a></li>
<li><a class="reference internal" href="#running-under-fastcgi">Running Under FastCGI</a></li>
<li><a class="reference internal" href="#running-under-iis">Running Under IIS</a></li>
<li><a class="reference internal" href="#running-standalone-with-pastescript-and-cherrypy">Running Standalone with PasteScript and CherryPy</a></li>
<li><a class="reference internal" href="#configuration">Configuration</a></li>
<li><a class="reference internal" href="#using-tilecache-with-openlayers">Using TileCache With OpenLayers</a></li>
<li><a class="reference internal" href="#using-tilecache-with-mapserver">Using TileCache With MapServer</a></li>
<li><a class="reference internal" href="#using-with-python-mapscript">Using With Python-Mapscript</a></li>
<li><a class="reference internal" href="#seeding-your-tilecache">Seeding your TileCache</a><ul>
<li><a class="reference internal" href="#usage">Usage</a></li>
<li><a class="reference internal" href="#options">Options</a></li>
<li><a class="reference internal" href="#arguments">Arguments</a></li>
<li><a class="reference internal" href="#seeding-by-center-point-and-radius">Seeding by center point and radius</a></li>
<li><a class="reference internal" href="#examples">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#cleaning-your-tilecache">Cleaning your TileCache</a><ul>
<li><a class="reference internal" href="#id1">Usage</a></li>
<li><a class="reference internal" href="#id2">Options</a></li>
<li><a class="reference internal" href="#notes">Notes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#troubleshooting">TroubleShooting</a></li>
<li><a class="reference internal" href="#see-also">SEE ALSO</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">Welcome to TileCache&#8217;s documentation!</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="Caches.html"
                        title="next chapter">TileCache Caches</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/README.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="Caches.html" title="TileCache Caches"
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Welcome to TileCache’s documentation!"
             >previous</a> |</li>
        <li><a href="index.html">TileCache v2.11 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2008-2010, TileCache Project.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
  </body>
</html>