Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken images in setup. Remove unnecessary setup information. #71

Merged
merged 4 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added learners/images/01-rstudio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
168 changes: 65 additions & 103 deletions learners/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,192 +8,164 @@

## Data

You can download all of the data used in this workshop by clicking
[this download link](https://ndownloader.figshare.com/articles/2009586/versions/10). The file is 218.2 MB.
You can download all of the data used in this workshop by clicking [this download link](https://ndownloader.figshare.com/articles/2009586/versions/10). 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).
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](instructors/data.md).

## Option A: Local Installation

### Software

| Software | Install | Manual | Available for | Description |
| -------- | ------- | ------ | --------------------- | ------------------------------------------------------------- |
| [GDAL](https://www.gdal.org) | [Link](https://gdal.org/download.html) | [Link](https://gdal.org) | Linux, MacOS, Windows | Geospatial model for reading and writing a variety of formats |
| [GEOS](https://trac.osgeo.org/geos) | [Link](https://trac.osgeo.org/geos) | [Link](https://geos.osgeo.org/doxygen/) | Linux, MacOS, Windows | Geometry models and operations |
| [PROJ.4](https://proj4.org) | [Link](https://proj4.org/install.html) | [Link](https://proj4.org/index.html) | Linux, MacOS, Windows | Coordinate reference system transformations |
| [R](https://www.r-project.org) | [Link](https://cloud.r-project.org) | [Link](https://cloud.r-project.org) | Linux, MacOS, Windows | Software environment for statistical and scientific computing |
| [RStudio](https://www.rstudio.com) | [Link](https://www.rstudio.com/products/rstudio/download/#download) | | Linux, MacOS, Windows | GUI for R |
| [UDUNITS](https://www.unidata.ucar.edu/software/udunits/) | [Link](https://www.unidata.ucar.edu/downloads/udunits/index.jsp) | [Link](https://www.unidata.ucar.edu/software/udunits/#documentation) | Linux, MacOS, Windows | Unit conversions |
| Software | Install | Manual | Available for | Description |
|------------|------------|------------|------------|-------------------------|
| [R](https://www.r-project.org) | [Link](https://cloud.r-project.org) | [Link](https://cloud.r-project.org) | Linux, MacOS | Software environment for statistical and scientific computing |

Check warning on line 23 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[link text too short]: [R](https://www.r-project.org)

Check warning on line 23 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[uninformative link text]: [Link](https://cloud.r-project.org)

Check warning on line 23 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[uninformative link text]: [Link](https://cloud.r-project.org)
| [RStudio](https://www.rstudio.com) | [Link](https://www.rstudio.com/products/rstudio/download/#download) | | Linux, MacOS | GUI for R |

Check warning on line 24 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[uninformative link text]: [Link](https://www.rstudio.com/products/rstudio/download/#download)

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.

:::::::::::::::: spoiler

::: spoiler
## Windows

To install the geospatial libraries, install the latest version [RTools](https://cran.r-project.org/bin/windows/Rtools/)
:::

:::::::::::::::::::::::::

:::::::::::::::: spoiler

::: spoiler
## 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](https://www.kyngchaos.com/software/frameworks) for GDAL Complete. Be aware that several other libraries are also installed, including the UnixImageIO, SQLite3, and `NumPy`.

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 an error message about "unidentified developers". You can enable the installation by following [these instructions](https://kb.wisc.edu/page.php?id=25443) for installing programs from unidentified developers.
:::

:::::::::::::::::::::::::

:::::::::::::::: spoiler

::: spoiler
## macOS - Install with Homebrew (Advanced)

Alternatively, participants who are comfortable with the command line can install the geospatial libraries individually using [homebrew](https://brew.sh):

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

:::::::::::::::::::::::::

:::::::::::::::: spoiler

::: spoiler
## 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`](https://github.com/r-spatial/sf).

For **Ubuntu**:

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

For **Fedora**:

```bash
``` bash
$ sudo dnf install gdal-devel proj-devel geos-devel
```

For **Arch**:

```bash
``` bash
$ pacman -S gdal proj geos
```

For **Debian**: The [rocker geospatial](https://github.com/rocker-org/geospatial) Dockerfiles may be helpful. Ubuntu Dockerfiles are found [here](https://github.com/r-spatial/sf/tree/master/inst/docker). These may be helpful to get an idea of the commands needed to install the necessary dependencies.

Check warning on line 80 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid


:::::::::::::::::::::::::
:::

### 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.

:::::::::::::::: spoiler

::: spoiler
## 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`](https://github.com/r-spatial/sf).

For **Ubuntu**:

```bash
``` bash
$ sudo apt-get install libudunits2-dev
```

For **Fedora**:

```bash
``` bash
$ sudo dnf install udunits2-devel
```

For **Arch**:

```bash
``` bash
$ pacaur/yaourt/whatever -S udunits
```

For **Debian**:

```bash
``` bash
$ sudo apt-get install -y libudunits2-dev
```

:::::::::::::::::::::::::
:::

### R

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

:::::::::::::::: spoiler

::: spoiler
## Windows

To install `R`, Windows users should select "Download R for Windows" from RStudio and CRAN's [cloud download page](https://cloud.r-project.org), 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".
:::

:::::::::::::::::::::::::

:::::::::::::::: spoiler

::: spoiler
## macOS

To install `R`, macOS users should select "Download R for (Mac) OS X" from RStudio and CRAN's [cloud download page](https://cloud.r-project.org), 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`.
:::

:::::::::::::::::::::::::

:::::::::::::::: spoiler

::: spoiler
## Linux

To install `R`, Linux users should select "Download R for Linux" from RStudio and CRAN's [cloud download page](https://cloud.r-project.org), 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](https://www.rstudio.com/products/rstudio/download/). 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).*

Check warning on line 141 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[uninformative link text]: [here](https://www.rstudio.com/products/rstudio/download/)

### R Packages

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

- [`dplyr`](https://cran.r-project.org/package=dplyr)
- [`ggplot2`](https://cran.r-project.org/package=ggplot2)
- [`raster`](https://cran.r-project.org/package=raster)
- [`rgdal`](https://cran.r-project.org/package=rgdal)
- [`rasterVis`](https://cran.r-project.org/package=rasterVis)
- [`remotes`](https://cran.r-project.org/package=remotes)
- [`sf`](https://cran.r-project.org/package=sf)
- [`dplyr`](https://cran.r-project.org/package=dplyr)
- [`ggplot2`](https://cran.r-project.org/package=ggplot2)
- [`raster`](https://cran.r-project.org/package=raster)
- [`rgdal`](https://cran.r-project.org/package=rgdal)
- [`rasterVis`](https://cran.r-project.org/package=rasterVis)
- [`remotes`](https://cran.r-project.org/package=remotes)
- [`sf`](https://cran.r-project.org/package=sf)

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:
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:

![](/fig/01-rstudio.png){alt='RStudio layout'}
![](fig/01-rstudio.png){alt="RStudio layout"}

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

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

You should see a status message starting with:

```output
``` output
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)
==================================================
Expand All @@ -207,7 +179,7 @@

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

```output
``` output
The downloaded binary packages are in
/var/folders/7g/r8_n81y534z0vy5hxc6dx1t00000gn/T//RtmpJECKXM/downloaded_packages
```
Expand All @@ -222,24 +194,21 @@

Once up and running - you'll have full access to RStudio right from your browser:

![](/fig/docker.png){alt='RStudio layout in browser showing similarity to desktop layout'}
![](fig/docker.png){alt="RStudio layout in browser showing similarity to desktop layout"}

Please be aware that the `R` package `rasterVis` is not included in the `rocker/geospatial` Docker image. If your instructor teaches with this package then you will need to install this `R` package yourself. All other `R` packages will already be installed for you.

:::::::::::::::: spoiler

::: spoiler
## Downloading and Installing Docker Community Edition

To get started with Docker, download the [Docker Community Edition](https://www.docker.com/community-edition) from [Docker's store](https://store.docker.com/search?type=edition&offering=community). Community editions are available for [Windows](https://store.docker.com/editions/community/docker-ce-desktop-windows), [macOS](https://store.docker.com/editions/community/docker-ce-desktop-mac), and Linux operating systems including [Debian](https://store.docker.com/editions/community/docker-ce-server-debian), [Fedora](https://store.docker.com/editions/community/docker-ce-server-fedora), and [Ubuntu](https://store.docker.com/editions/community/docker-ce-server-ubuntu).

The download pages for each of these operating systems contain notes about some necessary system requirements and other pre-requisites. Once you download the installer and follow the on-screen prompts.

Additional installation notes are available in Docker's documentation for each of these operating systems: [Windows](https://docs.docker.com/docker-for-windows/install/), [macOS](https://docs.docker.com/docker-for-mac/install/), [Debian](https://docs.docker.com/install/linux/docker-ce/debian/), [Fedora](https://docs.docker.com/install/linux/docker-ce/fedora/), and [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/).
:::

:::::::::::::::::::::::::

:::::::::::::::: spoiler

::: spoiler
## Using the `rocker/geospatial` Docker Image via the Command Line

#### Download and Set-up
Expand All @@ -248,23 +217,23 @@

You need to have already installed Docker Community Edition (see instructions above) before proceeding. Once you have Docker downloaded and installed, make sure Docker is running and then enter the following command into the terminal to download the `rocker/geospatial` image:

```bash
``` bash
$ docker pull rocker/geospatial
```

Once the pull command is executed, the image needs to be run to become accessible as a container. In the following example, the image is named `rocker/geospatial` and the container is named `gis`. The [image](https://docs.docker.com/glossary/?term=image) contains the software you've downloaded, and the [container](https://docs.docker.com/glossary/?term=container) is the run-time instance of that image. New Docker users should need only one named container per image.

When `docker run` is used, you can specify a folder on your computer to become accessible inside your RStudio Server instance. The following `docker run` command exposes Jane's `GitHub` directory to RStudio Server. Enter the file path where your workshop resources and data are stored:

```bash
``` bash
$ docker run -d -P --name gis -v /Users/jane/GitHub:/home/rstudio/GitHub -e PASSWORD=mypass rocker/geospatial
```

When she opens her RStudio instance below, she will see a `GitHub` folder in her file tab in the lower righthand corner of the screen. Windows and Linux users will have to adapt the file path above to follow the standards of their operating systems. More details are available on [rocker's Wiki](https://github.com/rocker-org/rocker/wiki/Sharing-files-with-host-machine).

The last step before launching your container in a browser is to identify the port that your Docker container is running in:

```bash
``` bash
$ docker port gis
```

Expand All @@ -274,30 +243,28 @@

When you are done with a Docker session, make sure all of your files are saved locally on your computer **before closing your browser and Docker**. Once you have ensured all of your files are available (they should be saved at the file path designated in `docker run` above), you can stop your Docker container in the terminal:

```bash
``` bash
$ docker stop gis
```

#### Re-starting a Container

Once a container has been named and created, you cannot create a container with the same name again using `docker run`. Instead, you can restart it:

```bash
``` bash
$ docker start gis
```

If you cannot remember the name of the container you created, you can use the following command to print a list of all named containers:

```bash
``` bash
$ docker ps -a
```

If you are returning to a session after stopping Docker itself, make sure Docker is running again before re-starting your container!
:::

:::::::::::::::::::::::::

:::::::::::::::: spoiler

::: spoiler
## Using the `rocker/geospatial` Docker Image via Kitematic

#### Download and Install Kitematic
Expand All @@ -308,17 +275,17 @@

Once you have installed Kitematic, make sure the Docker application is running and then open Kitematic. You should not need to create a login to use Kitematic. If prompted for login credentials, there is an option to skip that step. Use the search bar in the main window to find `rocker/geospatial` (pictured below) and click `Create` under that Docker repository.

![](/fig/kitematicSearch.png)
![](fig/kitematicSearch.png)

Check warning on line 278 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/kitematicSearch.png

After downloading and installing the image, your container should start automatically. Before opening your browser, connect your Docker image to a local folder where you have your workshop resources stored by clicking on the `Settings` tab and then choosing `Volumes`. Click `Change` and then select the directory you would like to connect to.

![](/fig/kitematicLocal.png)
![](fig/kitematicLocal.png)

Check warning on line 282 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/kitematicLocal.png

When you open RStudio instance below, you will see the contents of the connected folder inside the `kitematic` directory in the file tab located in the lower righthand corner of the screen.

When you are ready, copy the `Access URL` from the `Home` tab:

![](/fig/kitematicURL.png)
![](fig/kitematicURL.png)

Check warning on line 288 in learners/setup.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/kitematicURL.png

Paste that url into your browser and, if prompted, enter `rstudio` for both the username and the password.

Expand All @@ -327,37 +294,32 @@
When you are done with a Docker session, make sure all of your files are saved locally on your computer **before closing your browser and Docker**. Once you have ensured all of your files are available (they should be saved at the file path designated in `docker run` above), you can stop your Docker container by clicking on the `Stop` icon in Kitematic's toolbar.

You can restart your container later by clicking the `Restart` button.
:::

:::::::::::::::::::::::::

:::::::::::::::: spoiler

::: spoiler
## Managing Docker Containers and Images

To obtain a list of all of your current Docker containers:

```bash
``` bash
$ docker ps -a
```

To list all of the currently downloaded Docker images:

```bash
``` bash
$ docker images -a
```

These images can take up system resources, and if you'd like to remove them, you can use the `docker prune` command. To remove any Docker resources not affiliated with a container listed under `docker ps -a`:

```bash
``` bash
$ docker system prune
```

To remove **all** Docker resources, including currently named containers:

```bash
``` bash
$ docker system prune -a
```

:::::::::::::::::::::::::


:::
Loading