Installation

In this article we'll see how to install QGIS and PostGIS in Windows and in Linxu (Ubuntu). With the result of this installation we can start to work with them.

Windows

PostGIS

PostGIS is an extension of PostgreSQL, so we need it in order to install PostGIS.

Download the PostgreSQL installer from its download page, following the link for your operating system (Windows 64 bit in my specific case).

Double click on the installer and it will start.

Start of the installer
Start of the installer

Click next to start the installation:

 

Select installation folder
Select installation folder

We need to select the installation folder. I prefer to leave the default location if there's no specific reason for select a different one.

Select data folder
Select data folder

In the next step the data folder must be selected. This is the folder where databases and configuration will be stored. I like to change this folder, because putting data in Program Files folder is something that I don't like (programs and data should be always separated). Select the folder that you want to use for storing databases.

Set the postgres password
Set the postgres password

Now we need to select a password for the superuser, that's named postgres. This is the root password that allows to modify everything, so be careful in choosing it.

Select connection port
Select connection port

In the next step we need to select the connection port. This is the port used for both local and remote connection, and is the port in which the PostgreSQL service will listen. I prefer to leave it to the default value, but you can change it obviously. Only, remember it if you change it, because it will be needed in order to connect to databases and work on them.

Set default database locale
Set default database locale

In next step, we need to choose the default locale used for databases. You can leave it to the default value. I prefer to set explicitly a particular locale directly in the database, if needed.

Installation can start
Installation can start

When all steps are completed, is possible to start the installation. It will take some time...

Installation in progress...
Installation in progress...

The installation will copy files, start services and set database options chosen in previous steps.

PostgreSQL installation finished
PostgreSQL installation finished

When the installation of PostgreSQL finishes, we can end the installation program. But at this point we installed only the database. We need to continue the installation in order to install also PostGIS extension. So, before click to Finish, be sure that the checkbox for Stack Builder is selected. This allows us to continue the installation for extensions.

 

Select database for extensions
Select database for extensions

The Stack Builder will start. We need to select a database in order to install extensions. We should have only one PostgreSQL installation, the local one, so select it and we can continue the installation.

Select PostGIS extension
Select PostGIS extension

Now we can select the PostGIS extension. We need to expand Spatial Extensions section in order to find it. Be only careful about selecting the right architecture. In my case I've installed PostgreSQL 64 bit, and it will be the same architecture for the extension.

Installation can start
Installation can start

Now we can review the packages that will be installed (only one), so now we can download the selected packages.

Downloading PostGIS...
Downloading PostGIS...

Installer will begin to download the package. It's not so big so you shouldn't wait too much.

PostGIS is downloaded
PostGIS is downloaded

At this point, PostGIS extension is only downloaded. We need now to install it, so be sure that Skip Installation is unchecked, so we can proceed.

PostGIS extension installation starts
PostGIS extension installation starts

The PostGIS installation starts, and we can proceed. No problem here...

Choose components
Choose components

Now we can install components for PostGIS. It's already selected, but I prefer also to select Create spatial database. This option will create a sample database that can be helpful if you want to learn something. Many beginner tutorial are based on it.

PostGIS installation folder
PostGIS installation folder

Now we need to select the installation folder. We can leave it to the default value. I like to have the database extensions in the same folder of database. It's logical.

Enter database connection data
Enter database connection data

In order to install the extension, PostGIS needs to know the credential, so it can have the administrator access. The username is the standard one, postgres, so we need only to specify the password and the connection port that we set before.

Set sample database name
Set sample database name

Now we can select the name of the sample spatial database. Choose the one that you like. I like the default one. At this point extension installation starts.

PostGIS installation in progress
PostGIS installation in progress

The extension will be installed with selected options.

Set GDAL_DATA
Set GDAL_DATA

During the installation, PostGIS ask you to define some environment variable. The first one is GDAL_DATA that's needed for using the Gdal libraries that PostGIS uses in rasterization operation. You should allow the setting.

Enable raster drivers
Enable raster drivers

The raster drivers are also needed, and in order to work, you must also allow the setting of their environment variables.

Enabling Raster out
Enabling Raster out

Raster out should be also enabled. You know what to do, I suppose...

PostGIS installation completed
PostGIS installation completed

Now, we finally completed the PostGIS extension installation!!!

PostgreSQL installation also finished
PostgreSQL installation also finished

This concludes also the Stack Builder installation process. At this point you have a full working set-up of PostgreSQL and PostGIS. Congratulations!!!

 QGIS

Now we can install QGIS. Obviously, the first step is to download it, so go to the QGIS download page and select the package that you need. I'm using here the Windows standalone installer. When you've the package, we can start the installation.

 

Begin of QGIS installation
Begin of QGIS installation

At the beginning of the installation nothing particular happens, so we can go ahead.

QGIS License
QGIS License

Now we have to read and accept the License Agreement of QGIS. Almost everytime we accept everything without reading, but once in a while is not bad to read in order to understand what we're doing, if you want...

Set installation path
Set installation path

Now we can choose the installation path. Like before, usually the standard choice is a good one.

Install sample data
Install sample data

The installer now asks if we want to install some sample data. If you want to explore QGIS by yourself, and not using only these articles, I suggest you to install them, because you can work with some real data.

Installation in progress
Installation in progress

At this point the installation of QGIS starts. It's possible to see the progress of the installation.

North Carolina data, is it right for you?
North Carolina data, is it right for you?

Before installing sample data set (if you choose to install them), a confirmation dialog will appear. This is the one for the North Carolina data set.

North Carolina data installation
North Carolina data installation

North carolina data will be downloaded and installed.

South Dakota confirmation
South Dakota confirmation

Now it's time to accept to install data of South Dakota...

South Dakota data installation
South Dakota data installation

And South Dakota data will be downloaded and installed as well.

Alaska sample data confirmation
Alaska sample data confirmation

Last, but not last, the sample data set for Alaska. Press OK and continue.

Alaska data installation
Alaska data installation

Also these data will be downloaded and installed. Finally we finished to install sample data!

QGIS installation completed
QGIS installation completed

And finally we completed the installation of QGIS. Congratulations! Now we can start this program, but we'll see it in next articles!

 Linux

PostGIS

In Linux (Ubuntu) the installation of PostGIS is more straightforward, because we can use qpt-get.

In order to install PostGIS, we need to install following packages:

$ sudo apt-get install postgis postgis-gui postgis-doc

And that's all.. Simple, isn't it?

QGIS

QGIS is also present in Ubuntu repositories, so in order to install you can simply install it with this command:

sudo apt-get install qgis

It will install everything is needed.

As you can see, the installation of our programs in Ubuntu is really simple.

Conclusions

In this article we've seen how to install QGIS and PostGIS in our computers. In next articles we'll start to work with them. Stay tuned!!!

 

Add comment


Security code
Refresh

Articles Feed