Book Image

QGIS Blueprints

By : Ben Mearns
Book Image

QGIS Blueprints

By: Ben Mearns

Overview of this book

Table of Contents (14 chapters)
QGIS Blueprints
About the Author
About the Reviewers

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

  4. Click on Test Connect to make sure you've entered the correct information.

  5. You may wish to save your credentials, as shown here:

Importing into PostGIS with DB Manager

Once we've added the database connection, DB Manager is where we'll be...