Skip to content

Commit

Permalink
Sketched out basic script for rendering direct from .mml files
Browse files Browse the repository at this point in the history
  • Loading branch information
migurski authored and Michal Migurski committed Jun 16, 2012
1 parent 2ba5516 commit d15019f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cascadenik-render.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import cascadenik
from cascadenik import mapnik

import Image

def main(src_file):
mmap = mapnik.Map(640, 480)

cascadenik.load_map(mmap, src_file, '.', verbose=True)

print mmap

mmap.zoom_to_box(mapnik.Box2d(-20000000, -15000000, 20000000, 15000000))

img = mapnik.Image(640, 480)
mapnik.render(mmap, img)

print img

img = Image.fromstring('RGBA', (640, 480), img.tostring())

img.show()

if __name__ == '__main__':

main('doc/example4.mml')

0 comments on commit d15019f

Please sign in to comment.