Part 2. Putting PostGIS to Work

 

In part 1 of PostGIS in Action, we covered all the building blocks you’ll need to solve spatial problems. By now you should be able to set up a PostGIS database, populate it with data, and be able to transform between disparate spatial reference systems. You should also be comfortable using the most common functions in PostGIS and be able to take advantage of their prowess when writing SQL. In part 2, we’ll put the pieces together to solve real problems. The important lessons we want you to take away from part 2 entail how we tackle each problem, starting with building a correct formulation, setting up an appropriate structure to support the analysis, choosing the most appropriate PostGIS functions, and putting it all together using SQL. Chapter 8 covers various common problems that you’ll come across in building spatial queries for applications. We’ll demonstrate how to solve these problems with PostGIS spatial functions and ANSI SQL constructs as well as PostgreSQL–specific enhancements to SQL. We’ll then dive into building PostgreSQL functions. For some problems, we’ll demonstrate more than one approach to arriving at a solution.