Espen, Great, thanks for reporting back!
Note in trunk we now have: mapnik.has_cairo() function which indicates whether cairo/cairomm support was compiling into the libmapnik.dylib and mapnik.has_pycairo() function which indicates support for pycairo (compiled into Mapnik python bindings + the availability of the 'cairo' module) Dane On Nov 16, 2009, at 11:01 AM, Espen Isaksen wrote: > Ok, that did the trick. I compiled myself according to the > instructions and now it is working :-) > > Espen > > 2009/11/15 Espen Isaksen <[email protected]>: >> Ok, thanks for your response. I'll file a ticket and try to install >> Mapnik from source instead tomorrow. >> >> Espen >> >> >> 2009/11/15 Dane Springmeyer <[email protected]>: >>> This means that cairo support was not compiled into the python >>> bindings >>> (likely because pycairo headers could not be found). >>> >>> This is a known limitation of the Mapnik port from macports. When I >>> initially wrote the portfile I could not get the right PKG_CONFIG >>> paths to >>> propagate from Macports build system to the Mapnik build >>> environment. >>> >>> I've not had time to look back into it, but you should feel >>> welcome to file >>> a ticket at Macports. >>> >>> Or you can try rebuilding trunk against your macports libraries >>> like: >>> >>> http://trac.mapnik.org/wiki/MacInstallation#RouteAOption2-InstallMapnikSVNTrunkfromsource >>> >>> Dane >>> >>> On Nov 15, 2009, at 9:18 AM, Espen Isaksen wrote: >>> >>>> 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 >>> >>> >> _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

