
Preface
How close is the nearest hospital from my children's school? Where were the property crimes in my city for the last three months? What is the shortest route from my home to my office? What route should I prescribe for my company's delivery truck so as to maximize equipment utilization and minimize fuel consumption? Where should the next fire station should be built so as to minimize the response time?
People ask these questions and others like them every day all over this planet. Answering these questions require a mechanism capable of thinking in two or more dimensions. Historically, a Desktop GIS application was used to formulate an answer for each question. This method—though completely functional—is incapable of answering many questions at once. In addition, this method is typically unable to effectively manage and operate on massive spatial datasets, such as all of the roads of Europe for 2013 in one dataset, or allow tasks to be automated instead of significant pointing and clicking.
Once scalability, support for large datasets, and a direct input mechanism are required or desired, most users explore using a spatial database. There are several spatial database software available, some proprietary and others open source. PostGIS is an open source spatial database software and is probably the most accessible of all spatial database software.
PostGIS runs as an extension to provide spatial capabilities to PostgreSQL databases. In this capacity, PostGIS permits the inclusion of spatial data alongside data typically found in a database. By having all of the data together, questions such as "What is the rank of all of the police stations after taking into account the distance for each response time?" are possible. New or enhanced capabilities are possible by building upon the core functions provided by PostGIS and the inherent extensibility of PostgreSQL.
PostGIS Cookbook uses a problem-solving approach to help you acquire a solid understanding of PostGIS. Hopefully, this book provides answers to some common spatial questions and gives you the inspiration and confidence to use and enhance PostGIS in finding solutions to challenging spatial problems.