Skip to content

Instantly share code, notes, and snippets.

@skorasaurus
Created November 14, 2011 17:12
Show Gist options
  • Save skorasaurus/1364479 to your computer and use it in GitHub Desktop.
Save skorasaurus/1364479 to your computer and use it in GitHub Desktop.
python script for mapnik [xml]
#!/usr/bin/env python
import mapnik2
mapfile = 'barsoob3.xml'
map_output = 'mapnikxmloutput.png'
m = mapnik2.Map(800, 600)
mapnik2.load_map(m, mapfile)
bbox = mapnik2.Envelope(mapnik2.Coord(-81.738, 41.435), mapnik2.Coord(41.459,-81.6723))
m.zoom_to_box(bbox)
print "Scale = " , m.scale()
mapnik2.render_to_file(m, map_output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment