Wednesday, September 16, 2009

MapServer and TileCache

Spent some time today looking at using TileCache with MapServer. I used in part these docs. Other useful docs are here from Metacarta. I walked through the following (note I am using my work with Mapserver described in an earlier post):

1) Installed Python

2) Downloaded TileCache

3) Unzipped the TileCache directory, ran the setup executable and copied the contents under the directory into C:\ms4w\Apache\cgi-bin

4) Opened C:\ms4w\Apache\cgi-bin\tilecache.cgi and changed the top line to:

#!C:/Python25/python.exe -u

5) I added the following to the C:\ms4w\Apache\cgi-bin\tilecache.cfg file

[mapserver]
type=WMS
url=http://localhost:81/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/wms_mapserver/data/ms_wms.map
extension=png
layers=states_ugl
SRS=EPSG:4326
bbox=-97.6169,39.9179,-81.745,51.0875

6) Running the following:

http://localhost:81/cgi-bin/tilecache.cgi?layers=mapserver&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:4326&bbox=-97.6169,39.9179,-81.745,51.0875&format=image/png&width=400&height=300

gives the map image served by MapServer.

No comments: