Chapter 8. Using Python and Mapnik to Generate Maps
Because geospatial data is almost impossible to understand until it is displayed, the creation of maps to visually represent spatial data is an extremely important topic. In this chapter we will look at Mapnik, a powerful Python library for generating maps out of geospatial data.
This chapter will cover the following:
Underlying concepts used by Mapnik to generate maps
Creating a simple map using the contents of a shapefile
Different data sources that Mapnik supports
Using rules, filters, and styles to control the map generation process
Using "symbolizers" to draw lines, polygons, labels, points, and raster images onto your map
Defining the colors used on a map
Working with maps and layers
Setting your options for rendering a map image
The
mapGenerator.py
module, introduced in the previous chapter, uses Mapnik to generate mapsUsing map definition files to control and simplify the map-generation process