Created
May 23, 2013 16:57
-
-
Save springmeyer/5637596 to your computer and use it in GitHub Desktop.
Example of using the Mapnik python API to save a map constructed in python into an XML string or file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import mapnik | |
>>> m = mapnik.Map(256,256) | |
>>> m.background = mapnik.Color('green') | |
>>> print mapnik.save_map_to_string(m) | |
<?xml version="1.0" encoding="utf-8"?> | |
<Map srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" background-color="rgb(0,128,0)"/> | |
>>> mapnik.save_map(m,'file.xml') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment