Overview

Overview

This workshop is designed to be run on your local machine. First, you will need to download the data we use in the workshop. Then, you need to set up your machine to analyze and process geospatial data. We provide instructions below to either install all components manually. If applicable: before you install the software, please log out of any external drives (e.g. google drive, onedrive, dropbox, etc.) on your device.

Install Test

After you have finished installing the data and software: To check that you have everything configured correctly, and that you are prepared for the workshop, please download this zip archive. The Install Test is meant to help check if you have all the required R packages.

  1. Extract the files to your local computer
  2. RESTART RStudio.
  3. Doubleclick on InstallTest.r
  4. If your computer is properly configured, you should be able to execute the script from top to bottom without errors. After the script runs, you should have five objects in your environment and a map in your plots pane. The map will take a few seconds to draw.
  5. If you don’t know how to run the script, you should spend time reviewing R before attending this workshop. The folder ‘InstallTest’ does NOT contain the data we will be using during the workshop.

Data

You can download the data we will use during the workshop by clicking this download link. The file is 218.2 MB.

Clicking the download link will automatically download all of the files to your default download directory as a single compressed (.zip) file. To expand this file, double click the folder icon in your file navigator application (for Macs, this is the Finder application).

For a full description of the data used in this workshop see the data page.

Software

Software Install Manual Available for Description
GDAL Link Link Linux, MacOS, Windows Geospatial model for reading and writing a variety of formats
GEOS Link Link Linux, MacOS, Windows Geometry models and operations
PROJ.4 Link Link Linux, MacOS, Windows Coordinate reference system transformations
R Link Link Linux, MacOS, Windows Software environment for statistical and scientific computing
RStudio Link   Linux, MacOS, Windows GUI for R
UDUNITS Link Link Linux, MacOS, Windows Unit conversions

We provide quick instructions below for installing the various software needed for this workshop. At points, they assume familiarity with the command line and with installation in general. As there are different operating systems and many different versions of operating systems and environments, these may not work on your computer. If an installation doesn’t work for you, please refer to the installation instructions for that software listed in the table above.

GDAL, GEOS, and PROJ.4

The installation of the geospatial libraries GDAL, GEOS, and PROJ.4 varies significantly based on operating system. These are all dependencies for sf, the R package that we will be using for spatial data operations throughout this workshop.

Windows

To install the geospatial libraries, install the latest version RTools

macOS - Install with Packages (Beginner)

The simplest way to install these geospatial libraries is to install the latest version of Kyng Chaos’s pre-built package for GDAL Complete. Be aware that several other libraries are also installed, including the UnixImageIO, SQLite3, and NumPy. Please install all items in the package.

After downloading the package in the link above, you will need to double-click the cardbord box icon to complete the installation. Depending on your security settings, you may get a warning message about “unidentified developers”, but you may continue with the installation. Please contact us or attend the workshop install party if you need help enabling the installation.

macOS - Install with Homebrew (Advanced)

Alternatively, participants who are comfortable with the command line can install the geospatial libraries individually using homebrew. We do not have the expertise to provide assistance on your installation using this method.

$ brew tap osgeo/osgeo4mac && brew tap --repair
$ brew install proj
$ brew install geos
$ brew install gdal2

Linux

Steps for installing the geospatial libraries will vary based on which form of Linux you are using. These instructions are adapted from the sf package’s README.

For Ubuntu:

$ sudo add-apt-repository ppa:ubuntugis
$ sudo apt-get update
$ sudo apt-get install libgdal-dev libgeos-dev libproj-dev

For Fedora:

$ sudo dnf install gdal-devel proj-devel proj-epsg proj-nad geos-devel

For Arch:

$ pacman -S gdal proj geos

For Debian: The rocker geospatial Dockerfiles may be helpful. Ubuntu Dockerfiles are found here. These may be helpful to get an idea of the commands needed to install the necessary dependencies.

UDUNITS

Linux users will have to install UDUNITS separately. Like the geospatial libraries discussed above, this is a dependency for the R package sf. Due to conflicts, it does not install properly on Linux machines when installed as part of the sf installation process. It is therefore necessary to install it using the command line ahead of time.

Linux

Steps for installing the geospatial will vary based on which form of Linux you are using. These instructions are adapted from the sf package’s README.

For Ubuntu:

$ sudo apt-get install libudunits2-dev

For Fedora:

$ sudo dnf install udunits2-devel

For Arch:

$ pacaur/yaourt/whatever -S udunits

For Debian:

$ sudo apt-get install -y libudunits2-dev

R

Participants who do not already have R installed should download and install it.

Windows

To install R, Windows users should select “Download R for Windows” from RStudio and CRAN’s cloud download page, which will automatically detect a CRAN mirror for you to use. Select the base subdirectory after choosing the Windows download page. A .exe executable file containing the necessary components of base R can be downloaded by clicking on “Download R 3.x.x for Windows”.

macOS

To install R, macOS users should select “Download R for (Mac) OS X” from RStudio and CRAN’s cloud download page, which will automatically detect a CRAN mirror for you to use. A .pkg file containing the necessary components of base R can be downloaded by clicking on the first available link (this will be the most recent), which will read R-3.x.x.pkg.

Linux

To install R, Linux users should select “Download R for Linux” from RStudio and CRAN’s cloud download page, which will automatically detect a CRAN mirror for you to use. Instructions for a number of different Linux operating systems are available.

RStudio

RStudio is a GUI for using R that is available for Windows, macOS, and various Linux operating systems. It can be downloaded here. You will need the free Desktop version for your computer. In order to address issues with ggplot2, learners and instructors should run a recent version of RStudio (v1.2 or greater).

R Packages

The following R packages are used in the various geospatial lessons.

To install these packages in RStudio, do the following:
1. Open RStudio by double-clicking the RStudio application icon. You should see something like this:

RStudio layout

2. Type the following into the console and hit enter.

install.packages(c("dplyr", "ggplot2", "raster", "rgdal", "rasterVis", "sf"))

You should see a status message starting with:

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/dplyr_0.7.6.tgz'
Content type 'application/x-gzip' length 5686536 bytes (5.4 MB)
==================================================
downloaded 5.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/ggplot2_3.0.0.tgz'
Content type 'application/x-gzip' length 3577658 bytes (3.4 MB)
==================================================
downloaded 3.4 MB

When the installation is complete, you will see a status message like:

The downloaded binary packages are in
/var/folders/7g/r8_n81y534z0vy5hxc6dx1t00000gn/T//RtmpJECKXM/downloaded_packages

You are now ready for the workshop!