29 October 2017 | fifiqn
Welcome to the first part in my short series on how to digitize using both QGIS and data from OSM. This guide is aimed at spatial planners based in Lesotho, don’t be afraid though no matter your background you’ll be able to follow along.
In this first part we’re going to get everything we need installed and ready to go.
Here, you are going to learn how to install PostgreSQL in windows.
Here are 3 steps to complete the PostgreSQL installation:
Download the PostgreSQL Installer for Windows
You need to download the installer here.
Click on the download installer from EnterpriseDB Choose the latest version to download. It takes few minutes to complete the download.
Double click on the installer file, an installation wizard will appear and guide you through multiple steps where you can choose different options that you would like to have in PostgreSQL.
The following illustrates each step and its options for installation. If you have a different version, you may get additional steps.
click next
Specify installation folder, choose your own or keep the default folder suggested by PostgreSQL installer.
now you can wait for the installation to run
This can be done through the pgAdmin application. First, go to your Local Disk C:. Now go to Program FilesX86, navigate the list to find postgresql and doubleclick on it. Open the 9.3 folder. Do the same thing for bin. Now, if you scroll down the list, you will find pgadmin3. Right click on it, go to create shortcut and click yes to create a desktop shortcut. now go to the desktop and doubleclick on the shortcut you have just created and pgadmin will be launched.
Second,Connect to PostgreSQL Server
This is done by simply doubleclicking on the server marked with the red x
Third, if everything is fine, the pgAdmin will display all the objects that belong to the server.
Here, you learn a step by step the installation of the actual version (2.18) of QGIS.
First, you need to download the software from here. Double click on the downloaded .exe file to install. Accept the install defaults to complete the process and launch
Congratulation! you’ve successfully installed PostgreSQL database server in your and QGIS PC.
In the previous article we saw how to set up Postgresql with PostGIS in Windows and how to set up a database and load it with shapefile data. In order to get OpenStreetMap data into a database, you could get the data in shapefile format and use the shapefile loader, but this may leave you without all the data that you want.
In this chapter we will learn how to use osm2pgsql, a command-line program for loading raw OSM data into a PostGIS database. We will go through the steps to set up osm2pgsql on Windows, though the steps should be roughly the same on another operating system, assuming you have set up your PostGIS database(s) correctly.
Osm2pgsql in my opinion is short or Open Street Map to(2) Post GIS Structured Querybased Language. Which means that you are getting raw osm data and loading it into postgis using sql.
Click here to download the windows version of osm2pgsql
This is a program that we will run to import the data, but in order for Windows to find it, we need to add its location to the system path.
Be careful not to erase anything as this will be highlighted
Add a semicolon to the end of the previous directory and then type in the full directory path of osm2pgsql.exe. In our case, since our osm2pgsql extract is in local disk C inside the osm folder, the directory path would be: ;C:\osm\osm2pgsql\x64;
if you are using a 62bit operating system or ;C:\osm\osm2pgsql\x32;
if you are using 32bit operating system
In the black command window that opens, type:
osm2pgsql.exe
If everything is working right, you should get a message like this:
That’s is we’ve now got everything setup that we need to start digitizing, see you in Part 2
You might also like to read my previous article Bye Bye Arcgis
Article by Refiloe Semethe