Routing is the process by which we construct paths from Point A to B, or calculate how far you can travel from Point A in a car in 30 minutes. To do these sorts of calculations, it's not enough to have some vector data representing roads or paths, the data needs to be carefully prepared and loaded into a PostgreSQL database with the pgRouting extension enabled on it.
pgRouting is an extension for PostgreSQL, that extends PostGIS to add the Routing functions. For PostGIS 2.0 onwards it can easily be added to any spatial database using the syntax:
create extension pgrouting;
For older versions it is slightly more complicated, but documentation can be found at pgrouting.org.
Vector line data such as roads must be converted into a network or topology before it can be used for routing. This is the process by which the different segments, or sections of a road between junctions are converted into edges, and the junctions are converted into nodes. This terminology will be covered in more detail later.
There are a number of packages available to take vector data such as OpenStreetMap, load it into PostgreSQL, and create the necessary network. These include:
There are pros and cons to each approach, but for large volumes or data and ease of installation and use, it's hard to beat osm2po.
Ordnance Survey MasterMap ITN data is a ready-made (non-free) network, supplied in gml format. This can be loaded into PostgreSQL using a tool such as Loader and then used directly.