Loading your OSM Data for Students of planning course run by Fingal County Council in Maseru 09/02/2015

Requirements

Contents

  1. Open PgAdmin
  2. Open PostGIS Database
  3. Create Lesotho Database
  4. Load in data from tar file
  5. Extra Resources

Open PgAdmin

Go to the start menu and look for OpenGeoSuite 3.x. Under this group you will find PgAdmin. Click this to open it.

open pg admin

Open PostGIS Database

Double click on PostGIS database on the left.

Next a prompt will show asking for a password.

You should then enter whatever the password is for your normal windows login. Then click OK.

open pg admin

Create Lesotho Database

CREATE DATABASE lesotho;

Right click on the Databases. Then click New Database. open pg admin

Enter lesotho as the name for the new database and click OK. open pg admin

Now click on the lesotho database to load it up.

Click on SQL button in the top bar.

open pg admin

Type in the following to window that is now open.

CREATE EXTENSION postgis;

You must then click the Execute Query button at the top. When the query has finished running it looks like the image below. open pg admin

Load in data from tar file

Now in this step we need to make sure we have a copy of the lesotho_osm1.tar file on our computer. This is required for the next few actions.

Close the SQL Query window. When prompted to save the query, Click NO.

Next right click on the lesotho database and choose **Restore **from the menu.

restore db

This window will open. Now click the ... and locate the lesotho_osm1.tar file. When you have selected the file click ok.

restore db

Now click Restore. This will take a few minutes before the query finishes.

restore db

When this finishes click the X to close the window. Now go to the tables section under the lesotho database (lesotho => Schemas => public => tables). You should now have the same tables as below:

restore db

Congratulations you now have your OSM data in a database which you can use with QGIS.

Extra Resources