Summary
In this chapter, we explored the Mapnik map-generation toolkit in depth. We learned that maps are composed of multiple layers, drawn one on top of the other using the painter's algorithm. We saw that each layer has a data source and a list of styles that determine how the data is to be displayed. Styles are referred to by name, so they can be shared between the various map layers.
We learned that each style has a list of rules associated with it, where each rule can optionally have a filter limiting the set of features to be displayed as well as a list of symbolizers that control how the matching features are to be drawn.
We then saw how the mapnik.Map
object combines the styles and map layers and how the map can be used to zoom in to a particular area of the world before rendering an image based on the map's contents.
We put all these concepts together into a simple map-generating program before delving deeper into the Mapnik library. We examined four of the major types of data sources...