Visualizing the pgRouting results in QGIS
In the previous recipe, Creating a routing network for pgRouting, we imported a network layer, built the topology, and finally tested the routing. Building on these results, this recipe will show you how to visualize the routing results on a map in QGIS.
Getting ready
You should first go through the previous recipe, Creating a routing network for pgRouting, to set up the necessary PostGIS tables. Alternatively, you can use your own network tables, but be aware that you may have to alter some of the SQL statements if your table uses different column names.
How to do it…
To visualize the results in QGIS, we can use the DB Manager SQL window, as shown in the following screenshot. The extended query that we use here joins the routing results back to the original network table to get the route link geometries, which we want to display on the map:
Open DB Manager by navigating to Database | DB Manager.
In Tree to the left of the dialog, select the database that...