1

I would like to create Mapnik style using Python API and export it to XML-file. Creating style part is clear enough API has sufficient documentation. But I wasn't able to find function that does the import of created style to XML. Does it exist?

1 Answer 1

3

You can use mapnik.save_map()

import mapnik
m = mapnik.Map(1440,800)
# ... add styling and layers ...
mapnik.save_map(m, "output.xml")
1
  • By the way, I found the Mapnik Python documentation to be lacking a lot as well. I found a search engine for Python code called Nullege, it helps a lot in discovering Mapnik features and how to use them.
    – chrki
    Commented Feb 2, 2016 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.