Hi!

I test the following code found on the wiki site:

import mapnik
import cairo

mapfile = 'world_styles.xml'
map_output = 'mapfile.pdf'
projection = '+proj=latlong +datum=WGS84'

mapnik_map = mapnik.Map(1000, 500)
mapnik.load_map(mapnik_map, mapfile)
bbox = mapnik.Envelope(-180.0,-90.0,180.0,90.0)
mapnik_map.zoom_to_box(bbox)
file = open(map_output, 'wb')
surface = cairo.PDFSurface(file.name, mapnik_map.width, mapnik_map.height)
mapnik.render(mapnik_map, surface)
surface.finish()

When running this code I get the following error on mapnik.render():

traceback (most recent call last):
  File "cairo_world.py", line 19, in <module>
    mapnik.render(mapnik_map, surface)
Boost.Python.ArgumentError: Python argument types in
    mapnik._mapnik.render(Map, cairo.PDFSurface)
did not match C++ signature:
    render(mapnik::Map, mapnik::Image32 {lvalue})
    render(mapnik::Map, mapnik::Image32 {lvalue}, unsigned int, unsigned int)

The XML file works fine for regular rendering. I am using Mapnik 0.6.0
through Macports.

Can anybody help me in the right direction?

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

Reply via email to