knitr::opts_chunk$set(
  #fig.path = "https://raw.githubusercontent.com/jannes-m/RQGIS/master/figures/",
  fig.align = "center",
  collapse = TRUE,
  comment = "#>"
)

Vignette info

This vignette guides you through the installation process of QGIS3, GRASS- and SAGA-GIS on three different platforms (Windows, Mac, Linux). Please use the QGIS3 long-term release. Following our instructions should ensure that RQGIS3 will work properly. With the exception of SAGA, we recommend to use the latest stable version of all software packages. Though other versions might also work with RQGIS3, we did not test this.

Overall, RQGIS3 allows access to almost 1000 geoalgorithms. However, please note that the number of geoalgorithms you can use from within RQGIS3 depends on the platform, the system architecture, the selection of installed third-party providers and software package versions.

Windows

There are at least two options to install QGIS on Windows in such a way that RQGIS3 can access QGIS. The first option is the Standalone Installer from the QGIS installer page. This will install QGIS3 along with the third-party providers GRASS and SAGA, and most likely will meet the needs of most users. However, if you would like to install specific software versions and use even more third-party providers, use the OSGeo4W Network installer. This installer is available on the QGIS installer page as well as on the OSGeo4W-website. Download it and follow the instructions when executing the installer.

Linux

Ubuntu

QGIS3 (and GRASS)

If you install QGIS3 with the built-in software managers, you will most likely get an outdated QGIS3 version. To install more recent QGIS3 releases, we recommend to follow the installation instructions from the QGIS3 installers website.

Here, we just describe exemplarily the QGIS3 installation procedure under Debian/Ubuntu following the description found here. RQGIS3 should also work with Linux derivatives other than Ubuntu. However, we did not test this.

Open a terminal window. First of all, make sure to remove QGIS3 and GRASS packages you may have installed before from other repositories:

sudo apt-get --purge remove qgis
sudo apt autoremove
sudo apt-get update

Next add the correct repository to /etc/apt/sources.list. Here, we use the current long-term release. To also install GRASS7, we have to add the ubuntugis-unstable ppa repository.

QGIS 3.x for Ubuntu 18.04

# add QGIS repository for Ubuntu 18.04 to sources.list
sudo sh -c 'echo "deb http://qgis.org/ubuntu-ltr bionic main" >> /etc/apt/sources.list'
sudo sh -c 'echo "deb-src http://qgis.org/ubuntu-ltr bionic main" >> /etc/apt/sources.list'
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable

QGIS 3.x for Ubuntu 16.04

Since xenial lacks a native gdal2 installation, we will use the "ubuntugis" repos including its "ubuntugis-unstable" repo (for gdal2) to install QGIS.

# add QGIS repository for Ubuntu 16.04 to sources.list
sudo sh -c 'echo "deb http://qgis.org/ubuntugis xenial main" >> /etc/apt/sources.list'
sudo sh -c 'echo "deb-src http://qgis.org/ubuntugis xenial main" >> /etc/apt/sources.list'
sudo sh -c 'echo "deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main" >> /etc/apt/sources.list'
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable

For other Ubuntu releases, simply replace 'xenial' with the respective release name.

Next we need to add the GPG key to avoid key errors:

wget -O - https://qgis.org/downloads/qgis-2019.gpg.key | gpg --import
# verify fingerprint
gpg --fingerprint 51F523511C7028C3
gpg --export --armor 51F523511C7028C3 | sudo apt-key add -

After that, we can install QGIS3 and GRASS as follows:

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

SAGA

SAGA's current long term release is 7.3. Until now, QGIS3 only supports SAGA versions 2.3.x. In the meantime, however, SAGA 2.3.x is no longer actively developed, and depends on old gdal and proj libraries which conflict with those used by QGIS3 and GRASS7. Therefore, we can only suggest to wait until QGIS3 also supports a more recent version of SAGA. Please note that under Debian which is not using the ubuntugis-unstable repository, one can still use SAGA 2.3.1 and QGIS3 and GRASS7 (see the geocompr-dockerfile for an example). So in the meantime, we can offer this Docker image available on docker hub as an alternative to be able to use SAGA also with QGIS3. Please see the geocompr landing page for further instructions how to use it.

Arch Linux

You can install various QGIS and GRASS versions from the Arch User Repository. We recommend to use the yaourt package manager. At the moment it is not possible to use SAGA in conjunction with QGIS3 on Arch-based OS. Please use the geocompr docker image as described in the previous section.

Mac OS X

SAGA

There is no binary install of SAGA for macOS. We recommend to use the bottle installation from homebrew:

# brew tap osgeo4mac
brew install osgeo-saga-gis-lts
brew link --force osgeo-saga-gis-lts

If you do not link SAGA with force, QGIS will not be able to detect SAGA.

Alternatively, you can compile SAGA from source from the SAGA website. However, this is tedious and QGIS only supports the SAGA LTS version.

GRASS

You can install GRASS7 via homebrew:

# brew tap osgeo4mac
brew install osgeo-grass7

The binary GRASS installation can be found here. However, we recommend to use the homebrew approach.

When installing GRASS7 independently of QGIS via homebrew, please make sure to install it before you have installed QGIS. Only this way, the path for the QGIS processing plugin will be updated. Otherwise, the GRASS installation will work, however, GRASS7Utils.grassPath(), a QGIS function that links to the GRASS installation, gives back a non-existing path such as /Applications/Grass-7.0.app/Contents/MacOS which in turn prevents GRASS algorithms from working from within QGIS.

QGIS

Two options exist installing QGIS on macOS

  1. Using homebrew (recommended)
# brew tap osgeo/osgeo4mac
brew install osgeo-qgis-ltr

Check brew info osgeo-qgis for more available options. However, if you use them, QGIS will be compiled from source which may take > 30 min (depending on your system). Otherwise, pre-built bottles (= binaries) will be used which speeds up the installation process a lot.

Note: Make sure to install SAGA and GRASS before QGIS so that QGIS finds the correct paths.

  1. Using the official QGIS binary

We currently do not support the QGIS installer from https://www.qgis.org/en/site/forusers/download.html due to technical issues getting it working with RQGIS3. We may add support for it in the future.



jannes-m/RQGIS3 documentation built on Oct. 12, 2020, 7:28 a.m.