On Nov 3, 2009, at 3:04 AM, Tyler Durden wrote:

> Hi,
> I have lots of geo TIFF's or ECW's and I want to render tiles with  
> mapnik.
> I'm using gdaltindex to make a shapefile with those TIFF's:
>
> gdaltindex orthos.shp tiffs/*.tif
>

gdalindex is designed for creating a vector shapefile to be read as an  
index to rasters for Mapserver, not Mapnik.

Try http://www.gdal.org/gdalbuildvrt.html

> Right now I'm not worried about the projection, I just want to get  
> it done.

Then your rasters must be in the same projection as your Map.

> The output file of the script above is a blue rectange(with nothing).
> Any idea what I'm doing wrong?
>

Yes, your layer definition is for a shapefile, but it needs to point  
to a raster dataset, either one of your tiffs or a VRT of one or more  
of them.

I highly recommend getting it working with one tiff first.

Also, in your script below, trying zooming you map to the BBOX of the  
layer, so you ensure that you are rendering in the right place:

m.zoom_to_box(m.layers[0].envelope())

Dane



> Thanks.
>
> Python:
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
>
> import mapnik
>
> mapfile = 'shapes.xml'
> map_output = 'shapes.png'
>
> m = mapnik.Map(1024, 600)
> mapnik.load_map(m, mapfile)
>
> # LL = -8.633763, 41.152469
> # UR = -8.609265, 41.164495
>
> bbox = mapnik.Envelope(mapnik.Coord(-8.633763, 41.152469),
> mapnik.Coord(-8.609265, 41.164495))
>
> m.zoom_to_box(bbox)
> mapnik.render_to_file(m, map_output)
>
>
> The XML:
>
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE Map>
> <Map bgcolor="steelblue" srs="+proj=latlong +datum=WGS84">
>  <Style name="raster">
>    <Rule>
>      <RasterSymbolizer />
>    </Rule>
>  </Style>
> <Layer name="porto" status="on">
>    <StyleName>raster</StyleName>
>    <Datasource>
>      <Parameter name="type">shape</Parameter>
>      <Parameter
> name="file">/home/tyler/Projects/Python/tile_tests/shapes/ 
> orthos.shp</Parameter>
>    </Datasource>
>  </Layer>
> </Map>
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to