Database importing and topological relationships

Now that we've prepared the OSM data, we need to actually load it into the database. Here, we can generate the topological relationships based on geographic relationships as determined by PostGIS.

Connecting to the database

Although we will be working from the Database Manager when dealing with the database in QGIS, we will first need to connect to the database through the normal "Add Layer" dialog. Perform the following steps:

  1. Navigate to Layer | Add Layer | Add PostGIS Layers.
  2. Click on New.
  3. In the Create a New PostGIS connection dialog, enter the following parameters, accepting others as their defaults:
    • Name: packt_c4
    • Host: localhost
    • Database: packt_c4
    • Username/password: As configured earlier in this chapter ...

Get QGIS: Becoming a GIS Power User now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.