Chapter 13. Managing a Spatial Database

The previous chapters explained how to interrogate and convert data, and how to select subsets of it for more customized use. This chapter is for those who need a spatial database for creating, managing, and manipulating data. Spatial databases combine the power of a relational database with geographic and tabular information. The focus of this chapter is on getting some spatial data into a database, querying it, and using it in a map. It will also cover how to use PostGIS data in a few different applications and how to export it into other formats.

Introducing PostGIS

PostGIS is a spatial (or geographic) extension of the popular open source PostgreSQL relational database. This chapter focuses on using the normal tabular components of PostgreSQL in conjunction with the spatial data management functions of PostGIS.

Tip

For more in-depth help with PostgreSQL, I recommend O'Reilly's Practical PostgreSQL (http://www.oreilly.com/catalog/ppostgresql/) and the PostgreSQL web site http://www.postgresql.org.

PostGIS is an open source extension developed by Refractions Research. Their web site (http://postgis.refractions.net) gives this summary of the product:

PostGIS adds support for geographic objects to the PostgreSQL object-relational database. In effect, PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend spatial database for geographic information systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. ...

Get Web Mapping Illustrated now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.