polylinie.de / tilecacheindex / Manual
Copyright © 2008 Steffen Macke
$Date: 2008-11-07 11:55:53 +0200 (Sun, 12 Oct 2008) $
Table of Contents
This document describes (step by step) how to use Map Tile Cacher, tilecacheindex and mapserver to create a Web Map Service (WMS) using tiles from various mapping services like OpenStreetMap or OpenAerialMap.
The tutorial assumes that you are using Windows. If you would like this tutorial to be extended with instructions for Linux, please contact the author.
OpenStreetMap data can be used freely under the terms of the Creative Commons Attribution-ShareAlike 2.0 license.
Installation of required software.
Create a folder c:\tilecacheindex
folder to
hold tilecacheindex installation and the tile cache.
MS4W provides a conveniant way to install UMN Mapserver on Windows.
The installer can be downloaded from: http://www.maptools.org/ms4w/
Install to the default location.
The ActivePerl distribution is available on Windows:
http://activestate.com/Products/activeperl/
Install to the default location.
Map Tile Cacher is a Perl script that allows to download tiles from various mapping services like OpenStreetMap or OpenAerialMap. It is available from the Mobile GMaps project:
http://www.mgmaps.com/cache/MapTileCacher.perl
Save the script as c:\tilecacheindex\MapTileCacher.pl
.
Map Tile Cacher uses wget to download the tiles. The GnuWin32 provides a wget version for windows:
http://gnuwin32.sourceforge.net/packages/wget.htm
Download the complete package and install to
c:\program files\gnuwin32
.
Tilecacheindex is available from polylinie.de:
http://polylinie.de/tilecacheindex/
Download the zip file and extract it to
c:\tilecacheindex
.
The zip file also contains a simple mapfile template,
tilecacheindex.map
.
Open a commandline (cmd.exe).
Add the wget location to the PATH:
PATH=%PATH%;c:\program files\gnuwin32\bin
Change the working directory to c:\tilecacheindex
.
cd \tilecacheindex
Start Map Tile Cacher:
MapTileCacher.pl
Being asked for the number of map tiles per file, enter 1:
1
Choose 1 as the hash size:
1
This example assumes that you are using OpenStreetMap. If you choose a different map type, you'll have to adjust the following commands accordingly.
OpenStreetMap
Choose a zoom level:
1
Enter the coordinates for which the tiles should be downloaded. This example downloads tiles for the whole world. Top left:
90,-180
Bottom right:
-90,180
Press enter.
If everything went right, the following tiles should have been
downloaded to
c:\tilecacheindex\MGMapsCache\OpenStreetMap_1
:
0_0.mgm |
0_1.mgm |
1_0.mgm |
1_1.mgm |
Note | |
---|---|
These files are acutally PNG files. As mapserver has no problems to process these files, no effort is taken to rename them. |
Note | |
---|---|
The 1 at the end of the folder name is the zoom level. |
Run tilecacheindex:
cd \tilecacheindex tilecacheindex MGMapsCache\OpenStreetMap_1 MGMapsCache\OpenStreetMap_1\tilecacheindex.shp
polylinie.de / tilecacheindex / Manual
Copyright 2007, 2008 Steffen Macke | Imprint