In this chapter, we looked at how spatial databases can be a powerful tool for geospatial data analysis. We covered the important concepts behind spatial databases, and installed PostgreSQL, PostGIS, and psycopg2
onto your computer. We then got our hands dirty by creating a spatial database, importing data into that database, performing spatial queries, manipulating spatial data using PostGIS, and exporting data from a spatial database, all using Python code.
In the next chapter, we will explore how to use the Mapnik library to produce great-looking maps based on our geospatial data.