artemp/mapnik — Issue #381: Expose cairo functionality without needing pycairo
Author: artemp
Created: 2011-10-11 16:15:31+00:00
State: open
Labels: Boost_Python_Binding

The ability to pass Pycairo objects to mapnik is excellent (allows for drawing multiple times to canvas). But difficulty of installation of pycairo and the extra complexity of passing pycairo objects to mapnik rendering and creating cairo contexts/surfaces, highlight the need to be able to write to cairo formats without pycairo using an API as simple as the current method of writing to AGG-based formats.

The attached patch makes it possible to write to cairo formats with only cairo/cairomm installed and using the python api like:

{{{
mapnik.render(map,'output.pdf') # extension will be used to select cairo renderer
# or
mapnik.render(map,'output.png','ARGB32') # keyword will be used to select cairo renderer's PNG output (which can be non-Antialiased)
}}}