I'm attempting to use TileStache with a Mapnik source to output what would largely be transparent raster tiles from a GEOTIFF. I'm having difficulty getting Mapnik to produce images with the proper transparency, though. My Mapnik XML file looks like
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"> <Style name="style"> <Rule> <RasterSymbolizer /> </Rule> </Style> <Layer name="layer" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"> <StyleName>style</StyleName> <Datasource> <Parameter name="type">gdal</Parameter> <Parameter name="file">/home/ainlaen/test.tif</Parameter> <Parameter name="nodata">0</Parameter> </Datasource> </Layer> </Map>
I have tried setting the nodata values both in the XML and with GDAL. The image will appear with proper transparency when viewed in QGIS after having it set with GDAL, but will have a black background when rendered by Mapnik, regardless of nodata setting. I have tried rendering images directly using Mapnik, and the result is the same as when using TileStache, so I don't believe that's the problem. In addition, the tiles are not displayed in their proper positions, but that's probably best saved for a separate question.