On Feb 3, 2010, at 10:37 AM, David MENTRE wrote:

> Hello,
>
> My latest copy of ocitysmap (the back-end of MapOSMatic) is failing
> with my locally compiled version of Mapnik 0.7.0 with following
> exception:
>  File "/home/david/maposmatic/ocitysmap/ocitysmap/map_canvas.py",
> line 352, in my_render
>    ctx)
> ArgumentError: Python argument types in
>    mapnik._mapnik.render(Map, cairo.Context)
> did not match C++ signature:
>    render(mapnik::Map, mapnik::Image32 {lvalue})
>    render(mapnik::Map, mapnik::Image32 {lvalue}, unsigned int,  
> unsigned int)
>
> I'm stuck here. Any idea where I should look at?
>

This indicates that either Cairo or PyCairo headers were not found  
when you ran:

$ python scons/scons.py configure

So Mapnik was built without Cairo support.

You can confirm that this is the case by running these functions:

 >>> import mapnik
 >>> mapnik.has_cairo()
True
 >>> mapnik.has_pycairo()
True

You need both of those to report True for the ability to render Cairo  
contexts/surfaces via the Mapnik Python bindings.

So, try reconfiguring Mapnik and rebuilding.

python scons/scons.py CAIRO=True

On Ubuntu Karmic there is a bug in the cairomm package 
(https://bugs.launchpad.net/ubuntu/+source/cairomm/+bug/452733 
)  that make pkg-config fail to configure propertly and in turn tells  
Mapnik that Cairo support is not available. See my notes here for a  
solution:

http://trac.mapnik.org/wiki/UbuntuInstallation#InstallMapnikfromsource

Once  you've rebuild Mapnik with Cairo support you will can also  
confirm support for PYCAIRO by calling render() without arguments and  
seeing what objects you can pass it:

 >>> from mapnik import *
 >>> render()
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
Boost.Python.ArgumentError: Python argument types in
     mapnik._mapnik.render()
did not match C++ signature:
     render(mapnik::Map, PycairoContext*)
     render(mapnik::Map, PycairoContext*, unsigned int, unsigned int)
     render(mapnik::Map, PycairoSurface*)
     render(mapnik::Map, PycairoSurface*, unsigned int, unsigned int)
     render(mapnik::Map, mapnik::Image32 {lvalue})
     render(mapnik::Map, mapnik::Image32 {lvalue}, unsigned int,  
unsigned int)

Dane

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

Reply via email to