Created
February 23, 2013 01:46
-
-
Save YenTheFirst/5017929 to your computer and use it in GitHub Desktop.
rendering test image in python. less network traffic to database than node-mapnik for some reason.
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 | |
mmap = mapnik.Map(0, 0) | |
mapnik.load_map(mmap, path_to_xml) | |
mmap.width = 256 | |
mmap.height = 256 | |
mmap.zoom_to_box(mapnik.Box2d(-9079495.967826376,2817774.6107047386,-8766409.899970295, 3130860.6785608195 )) | |
img = mapnik.Image(256, 256) | |
mapnik.render(mmap, img) | |
img.save("test_output.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment