Ramiro Aznar
3 min readOct 26, 2016

--

How to install the most common open-source GIS applications on Ubuntu

Since my home computer refused to boot up, I decided to format my hard drive and install Ubuntu 16.04. In addition to Google Chrome and Sublime Text, the only other applications I needed were all my favorite open-source GIS software. So this is how I spent most of the Saturday morning [1]:

Mamata Akella’s Population Density Map [2].

PostgreSQL & PostGIS

PostgreSQL is a powerful object-relational database management system. But why should be used instead of other relational (or non-relational) DBS? Because PostGIS (and CARTO) is built on top of postgres. As explained here, you just need to type the following line on the command line to install postgres last version (9.5):

$ sudo apt-get install postgresql postgresql-contrib

If you are a beginner, maybe it would be useful to install pgadmin III, a very nice postgres UI:

$ sudo apt-get install pgadmin3

Finally, after connecting to postgres and creating a database, you can add PostGIS extension using these lines:

psql -d yourdatabase -c “CREATE EXTENSION postgis;”

QGIS

QGIS is my favorite desktop GIS software. What I like the most about QGIS is its plugins ecosystem and active community. In fact, last April I gave a QGIS introduction workshop with GeoInquietos Madrid. In order to install QGIS on Ubuntu, you need to first open your source.list using a text editor (in my case gedit):

$ sudo gedit /etc/apt/sources.list

And add the following line to the ubuntugis repository as explained here:

deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main

After that type:

$ sudo apt-get update
$ sudo apt-get install qgis python-qgis qgis-plugin-grass

Voilá!

JOSM

After watching Erik map 20 squares during the last mapathon, I realized the necessity of mastering JOSM. The OSM iD is more user friendly, but if you want to take one step further, JOSM is your platform. Again, as commented here, use this shortcut to add a new repository on your source.list:

$ echo deb https://josm.openstreetmap.de/apt alldist universe | sudo tee /etc/apt/sources.list.d/josm.list > /dev/null

Next, it is necessary to download and register the openstreetmap.de public key. That can also be done in a single line:

$ wget -q https://josm.openstreetmap.de/josm-apt.key -O- | sudo apt-key add -

The final item is to refresh the sources.

$ sudo apt-get update

Now you can install josm:

$ sudo apt install josm

GDAL/OGR

GDAL is the best library to work with spatial data. As mentioned in this blog post, there are many ways to install GDAL on Ubuntu. To get the latest GDAL/OGR version, add the PPA to your sources (this step could be avoided if we have installed QGIS using ubuntugis repository):

$ sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update

Then install the gdal-bin package:

$ sudo apt-get install gdal-bin

CARTO

Last but not least, CARTO. As you already know, CARTO is the most powerful web platform for analyzing and visualizing spatial data (and it just happens that I work there). Because installing CARTO is a more complex issue, I will redirect you to the documentation (and if you have problems, cartodb Google Group is really helpful). Maybe it is worth an entire blog post.

[1] This blog post was originated posted in my personal blog.
[2] https://mamataakella.carto.com/builder/25aaad68-7134-11e6-afae-0e3ebc282e83/embed

--

--

Ramiro Aznar

Environmental Biologist working as a Geospatial Data Engineer at Planet.