Tutorial: Using QGIS to visualise UrMoAC results

Task

Most of the visualisation we do is done using Python and matplotlib. But you may as well use usual geo information systems (GIS) for this purpose. This tutorial shows how to visualise UrMoAC results with QGIS.

Prerequisites

Let's assume you'd have computed the accessibility from buildings to the next public transport halt as described within the tutorial “Computing the accessibility to the next public transport halt”.

This means, you have the following tables:

  • berlin.osm20230428_network: the road network
  • berlin.osm20230428_buildings: the buildings
  • berlin.osm20230428_pthalts: the public transport halts
  • berlin.osm20230428_houses2pthalts: the accessibility values computed using UrMoAC

Visualisation using QGIS

Start QGIS and load the buildings first. You may have to add your database server to the list of known servers and open the path (host-scheme-table) to the buildings table. You may note that the OSM-importer osmdb_buildStructures.py has generated two different geometry columns — one with the centroids (as points) and one with polygons. Open berlin.osm20230428_buildings.polygon. You should see something like what is shown in the following image.

qgis_berlin_buildings4326.png

They are stored in WGS84 (EPSG 4326), so let's apply a proper projection, which is 25833 in Berlin's case. The result looks more like Berlin:

qgis_berlin_buildings25833.png

Now, load the accessibility table by choosing the menu “Database -> DB Manager”. The table berlin.osm20230428_houses2pthalts with the previously generated results should be selectable in your database tree. Double-click on it to add it to the project.

Now, connect the buildings to the osm20230428_houses2pthalts table. For this purpose, select the layer berlin.osm20230428_buildings.polygon and double-click on it. In the next menu choose “Joins”. Add a connection between the “gid” field of berlin.osm20230428_buildings.polygon and the “fid” field of osm20230428_houses2pthalts — because “fid” were our origins.

Now, select the layer's visualisation tab “Symbology”. Choose “Graduated” instead of “Single symbol” and “osm20230428_houses2pthalts_avg_tt” for value. Set the number of classes to 20 and press “Classifiy”. Select a nice color map. In the following image, the inversed “RdYlGn” is used. You may want to remove the borders of the polygons. The result are buildings colored by their travel time to the next public transport halt, as shown in the following image.

qgis_berlin_buildings25833colored.png

Yes, most of the area is white… Let's zoom at our institute's location, add the road network, and the public transport halts…

qgis_berlin_buildings25833colored_complete.png

Discussion

Well, this was a very fast example for using QGIS to visualise the results.

The major takeaway is that you have to connect a geographical representation of your origins (or destinations) with the measures generated by UrMoAC.