Introduction
So far, we have used PostGIS as a vector and raster tool, using relatively simple relationships between objects and simple structures. In this chapter, we will review an additional PostGIS-related extension: pgRouting. pgRouting allows us to interrogate graph structures in order to answer questions, such as "What is the shortest route from where I am to where I am going?" This is a domain heavily occupied by the existing web APIs (such as Google, Bing, MapQuest, and others) and services, but it can be better served by "rolling our own" services for many use cases. Which cases? It might be a good idea to create our own services in situations where we are trying to answer questions that aren't answered by the existing services, such as when the data available to us is better or more applicable, or when we need or want to avoid the Terms of Service conditions for these APIs.