1 | #!/usr/bin/env python3
|
---|
2 | import mapnik
|
---|
3 | mapfile = "world_population.xml"
|
---|
4 | m = mapnik.Map(1400, 600)
|
---|
5 | mapnik.load_map(m, mapfile)
|
---|
6 | bbox = mapnik.Box2d(mapnik.Coord(-180.0, -75.0), mapnik.Coord(180.0, 90.0))
|
---|
7 | m.zoom_to_box(bbox)
|
---|
8 | mapnik.render_to_file(m, 'world_population.png', 'png')
|
---|