From ccd3aef2f644d1e7cc7a1115c1a598499cccd26e Mon Sep 17 00:00:00 2001 From: springmeyer Date: Mon, 9 Jan 2012 09:19:28 -0800 Subject: [PATCH] more cleanup --- GettingStartedInXML.md | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/GettingStartedInXML.md b/GettingStartedInXML.md index bf4e63d..e0f9f21 100644 --- a/GettingStartedInXML.md +++ b/GettingStartedInXML.md @@ -24,27 +24,21 @@ First you will still need a python script that sets the basic map parameters and ```python #!/usr/bin/env python import mapnik - mapfile = 'world_styles.xml' - map_output = 'hello_world_using_xml_config.png' + stylesheet = 'world_style.xml' + image = 'world_style.png' m = mapnik.Map(600, 300) - mapnik.load_map(m, mapfile) - bbox = mapnik.Envelope(mapnik.Coord(-180.0, -90.0), mapnik.Coord(180.0, 90.0)) - m.zoom_to_box(bbox) - mapnik.render_to_file(m, map_output) + mapnik.load_map(m, stylesheet) + m.zoom_all() + mapnik.render_to_file(m, image) ``` - * Copy this code and save to a file called *world_map.py* + * Copy the above code and save to a file called `world_map.py` -Next you will need to create the *world_styles.xml* file referenced in the *world_map.py* - -Note: you will need to specify the path to the same Mapping Hacks [world borders shapefile](http://mappinghacks.com/data/world_borders.zip) using in Tutorial 1 +Next you will need to create the `world_style.xml` file referenced in the `world_map.py` script. ```xml + - - - - - + My Style shape - /path/to/your/world_borders + world_borders.shp ``` - * Copy this XML and save to a file called *world_styles.xml* beside the *world_map.py* script + * Copy this XML and save to a file called `world_style.xml` beside the `world_map.py` script. Now run that script with this command: