I want to generate SVG maps in Python using Mapnik 3.0.13 (built from source). I'm using version 3.0.13 of the Python bindings as well, built with PYCAIRO. My code:
The output SVG file looks like this:
Followed by ~200 MB of base64-encoded PNG garbage. I tried recompiling my library and bindings to use the native svg_renderer instead of Cairo, but got the same result. How do I get a "real" SVG? This is just a PNG file wrapped inside an SVG (in an extremely inefficient way). asked 01 Sep '17, 17:44 derkartograf |
I created a Mapnik issue for this: https://github.com/mapnik/mapnik/issues/3749 Turns out this happens when your style uses compositing operations like Removing all answered 05 Sep '17, 11:15 derkartograf I've accepted your answer here - hope that's OK!
(05 Sep '17, 13:01)
SomeoneElse ♦
|
The problem has been found to be something with SVG version support. You can build Mapnik with this patch applied: https://github.com/mapnik/mapnik/pull/4029#issue-251451960 or just use python-cairo with a code like:
See also https://help.openstreetmap.org/questions/65497/is-there-any-change-in-svg-exports/67940 answered 11 Feb '19, 23:41 kocio |
I have the same issue. PDF export works properly though (outputs a vector PDF)
See https://github.com/mapnik/python-mapnik/issues/137 - this appears to be a Mapnik issue.