[Tilecache] Setting Up tilecache to use mapnik

Jeffrey04 mycyberpet at yahoo.com
Mon Jun 29 04:03:46 EDT 2009


Hi,

I am trying to setup a tilecache installation that uses mapnik generated
tiles. However, the basic layer that comes with the default installation
works but not my mapnik layer. All I get from my mapnik layer is a set of
tiles in steelblue background color (as defined in the xml file)

this is what I have in my tilecache.cfg

[cache]
type=Disk
base=/tmp/tilecache

[basic]
type=WMS
url=http://labs.metacarta.com/wms/vmap0
extension=png

[mapnik]
type=Mapnik
mapfile=/home/jeffrey04/Projects/mapnik/world_styles.xml
metaTile=yes
#spherical_mercator=true
tms_type=google
srs=EPSG:900913
levels=18
metaBuffer=40

this is my xml file for mapnik (taken from mapnik tutorial, and uses the
mapnik provided world borders)

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map>
<Map bgcolor="steelblue" srs="+proj=latlong +datum=WGS84">

    <Style name="my">
        <Rule>
            <PolygonSymbolizer>
                <CssParameter name="fill">#f2eff9</CssParameter>
            </PolygonSymbolizer>
            <LineSymbolizer>
                <CssParameter name="stroke">rgb(50%,50%,50%)</CssParameter>
                <CssParameter name="stroke-width">0.1</CssParameter>
            </LineSymbolizer>
        </Rule>
    </Style>

    <Layer name="world" srs="+proj=latlong +datum=WGS84">
        <StyleName>my</StyleName>
        <Datasource>
            <Parameter name="type">shape</Parameter>
            <Parameter
name="file">/home/jeffrey04/Projects/mapnik/world_borders/world_borders</Parameter>
        </Datasource>
    </Layer>

</Map>

the open layers code

        <!--
        var map, layer;

        function init(){
            map = new OpenLayers.Map( $('map'), {'maxResolution': 360/512});
            map.addLayer(
                new OpenLayers.Layer.WMS( "mapnik",
                    "tilecache.cgi?", {layers: 'mapnik', format: 'image/png'
} )
            );
            layer = new OpenLayers.Layer.WMS( "basic",
                    "tilecache.cgi?", {layers: 'basic', format: 'image/png'
} );
            map.addLayer(layer);
            map.addControl(new OpenLayers.Control.LayerSwitcher())
            map.addControl(new OpenLayers.Control.Permalink());
            if (!map.getCenter()) map.zoomToMaxExtent();
        }
        // -->

The xml file is tested working by passing it to nik2img.py script that
generates .png file from xml.

Is there any detailed documentation on how to setup tilecache to work with
mapnik? Besides that, how can I diagnose a problem? is there a log or
something?

Regards,
Jeffrey04
-- 
View this message in context: http://n2.nabble.com/Setting-Up-tilecache-to-use-mapnik-tp3173112p3173112.html
Sent from the TileCache mailing list archive at Nabble.com.




More information about the Tilecache mailing list