Whether you're canvassing a congressional district, managing a sales region, mapping city bus schedules, or analyzing local cancer rates, thinking spatially opens up limitless possibilities for database users. PostGIS, a freely available open-source spatial database extender, can help you answer questions that you could not answer using a mere relational database. Its feature set equals or surpasses proprietary alternatives, allowing you to create location-aware queries and features with just a few lines of SQL code. PostGIS in Action is the first book devoted entirely to PostGIS. It will help both new and experienced users write spatial queries to solve real-world problems. For those with experience in more traditional relational databases, this book provides a background in vector-based GIS so you can quickly move to analyzing, viewing, and mapping data. Advanced users will learn how to optimize queries for maximum speed, simplify geometries for greater efficiency, and create custom functions suited specifically to their applications. It also discusses the new features available in PostgreSQL 9.0 /9.1 and PostGIS 2.0 and provides tutorials on using additional open source GIS tools in conjunction with PostGIS.