[Tilecache] Use of tileCache with Mapnik

kryptonite paschatap at gmail.com
Wed May 20 12:05:18 EDT 2009


Hey Arnaud, 
                 I think you got over with your problem and have a running
map. I am having trouble getting this simple demo thing to run with
mapnik+openlayers+tilecache..

below are my files that i have and all that I got was pink tiles. The tiles
are not being created too.


openlayers : index.html
var map, layer;

        var options = 	{
								 numZoomLevels:10,
								 maxResolution: 360/512,
								 projection: "EPSG:4326"

							  };

			    function init(){
				            map = new OpenLayers.Map( 'map', options);
				            layer = new OpenLayers.Layer.WMS( "VMap0",
				                    					"http://localhost/cgi-bin/tilecache.cgi?",
				                    					{
				                    						layers:'basice',
				                    						format: 'image/png'
				                    						srs: 'EPSG:4326'
														}
									 );
				            map.addLayer(layer);
				            map.addControl( new OpenLayers.Control.PanZoomBar());
							map.addControl( new OpenLayers.Control.MousePosition());
						    map.addControl( new OpenLayers.Control.LayerSwitcher());
						    if (!map.getCenter()) map.zoomToMaxExtent();

        }

tilecache.cfg
[basice]
type=Mapnik
layers=world
mapfile=C:\mapnik_0_6_0\demo\data\python\world_styles.xml
srs=EPSG:4326
bbox=-180.0,-90.0,180.0,90.0
projection=+proj=latlong +datum=WGS84


world_styles.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map>
<Map bgcolor="steelblue" srs="+proj=latlong +datum=WGS84">
  <Style name="My Style">
    <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 Style</StyleName>
    <Datasource>
      <Parameter name="type">shape</Parameter>
      <Parameter
name="file">C:\mapnik_0_6_0\demo\data\world_borders</Parameter>
    </Datasource>
  </Layer>
</Map>






geotribu wrote:
> 
> Thank you so much for your help. The problem was the relative path.
> 
> 
> Regards
> 
> 
> Arnaud
> 
> On Wed, Apr 29, 2009 at 9:34 PM, Dane Springmeyer
> <blake at hailmail.net>wrote:
> 
>> Arnaud,
>> Try setting the full path to your shapefile in the XML.
>>
>> For example:
>>
>>             <Parameter
>> name="file">/home/arnaud/data/tuto/TM_WORLD_BORDERS_SIMPL-0.2</Parameter>
>>
>>
>>
>> Also, make sure you are pointing to the shapefile name, not the folder it
>> is inclosed in.
>>
>> Lastly, if those things don't help try setting the projection property in
>> your config:
>>
>>  [world]
>> type=Mapnik
>> mapfile=/var/www/html/RetD/mapnik/mapfile.xml
>> layers=world
>> projection=+proj=latlong +datum=WGS84
>>
>>
>> Dane
>>
>>
>> On Apr 29, 2009, at 4:53 AM, Arnaud Vandecasteele wrote:
>>
>> Hi all,
>>
>> I'm trying to use MapNik and tileCache with my own data.
>> The facti is i can generate a png file with MapNik but when I try to do
>> the
>> same thing with TileCache I've only got the background I defined in My
>> XML
>> Mapfile (<Map srs="+proj=latlong +datum=WGS84" bgcolor="#4682b4">)
>>
>> My project is very simple and I don't know what is wrong. Could someaone
>> help to know where i made a mistake.
>>
>> Here is :
>>
>> ************* my python MapNik file :
>> import mapnik
>> mapfile="./mapfile.xml"
>> m = mapnik.Map(1400, 600)
>> mapnik.load_map(m, mapfile)
>> bbox = mapnik.Envelope(mapnik.Coord(-180.0, -75.0), mapnik.Coord(180.0,
>> 90.0))
>> m.zoom_to_box(bbox)
>> mapnik.render_to_file(m, './tuto02/world_populationTOTO.png', 'png')
>>
>>
>> ************* my xml file :
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <!DOCTYPE Map>
>> <Map srs="+proj=latlong +datum=WGS84" bgcolor="#4682b4">
>>     <Style name="My_Style">
>>     <Rule>
>>         <PolygonSymbolizer>
>>             <CssParameter name="fill">#c7e9b4</CssParameter>
>>         </PolygonSymbolizer>
>>         <LineSymbolizer>
>>             <CssParameter name="stroke">black</CssParameter>
>>             <CssParameter name="stroke-width">.1</CssParameter>
>>         </LineSymbolizer>
>>     </Rule>
>>     </Style>
>>     <Layer name="world" srs="+proj=latlong +datum=WGS84" status="on">
>>         <StyleName>My_Style</StyleName>
>>         <Datasource>
>>             <Parameter
>> name="file">./data/tuto/TM_WORLD_BORDERS_SIMPL-0.2</Parameter>
>>             <Parameter name="type">shape</Parameter>
>>         </Datasource>
>>     </Layer>
>> </Map>
>>
>>
>> ************* my TileCache configuration file :
>>  [world]
>> type=MapnikLayer
>> mapfile=/var/www/html/RetD/mapnik/mapfile.xml
>> layers=world
>>
>> TileCache generate all the tile but only with the background color.
>>
>> Best regards and thanks for your help.
>>
>> Arnaud
>> --
>> --------------------------------------------------------------------
>> Van De Casteele Arnaud
>> 72 Rue de la colline des camélias 97400 Saint-Denis
>> 0262 30 67 79 - 0692 23 73 17
>> SIG - WebMapping - GPS embarqué
>> Site internet : http://geotribu.net/
>> _______________________________________________
>> Tilecache mailing list
>> Tilecache at openlayers.org
>> http://openlayers.org/mailman/listinfo/tilecache
>>
>>
>>
> 
> 
> -- 
> --------------------------------------------------------------------
> Van De Casteele Arnaud
> 72 Rue de la colline des camélias 97400 Saint-Denis
> 0262 30 67 79 - 0692 23 73 17
> SIG - WebMapping - GPS embarqué
> Site internet : http://geotribu.net/
> 
> _______________________________________________
> Tilecache mailing list
> Tilecache at openlayers.org
> http://openlayers.org/mailman/listinfo/tilecache
> 
> 

-- 
View this message in context: http://n2.nabble.com/Use-of-tileCache-with-Mapnik-tp2740134p2947062.html
Sent from the TileCache mailing list archive at Nabble.com.




More information about the Tilecache mailing list