Skip to content

Commit fed2af1

Browse files
Merge pull request #71 from jonjab/main
Fix broken images in setup. Remove unnecessary setup information.
2 parents 5f2d7d8 + 60f7eb0 commit fed2af1

2 files changed

Lines changed: 65 additions & 103 deletions

File tree

learners/images/01-rstudio.png

386 KB
Loading

learners/setup.md

Lines changed: 65 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -8,160 +8,133 @@ This workshop is designed to be run on your local machine. First, you will need
88

99
## Data
1010

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

14-
Clicking the download link will automatically download all of the files to your default download directory as a single compressed
15-
(`.zip`) file. To expand this file, double click the folder icon in your file navigator application (for Macs, this is the Finder
16-
application).
13+
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).
1714

1815
For a full description of the data used in this workshop see the [data page](instructors/data.md).
1916

2017
## Option A: Local Installation
2118

2219
### Software
2320

24-
| Software | Install | Manual | Available for | Description |
25-
| -------- | ------- | ------ | --------------------- | ------------------------------------------------------------- |
26-
| [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 |
27-
| [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 |
28-
| [PROJ.4](https://proj4.org) | [Link](https://proj4.org/install.html) | [Link](https://proj4.org/index.html) | Linux, MacOS, Windows | Coordinate reference system transformations |
29-
| [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 |
30-
| [RStudio](https://www.rstudio.com) | [Link](https://www.rstudio.com/products/rstudio/download/#download) | | Linux, MacOS, Windows | GUI for R |
31-
| [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 |
21+
| Software | Install | Manual | Available for | Description |
22+
|------------|------------|------------|------------|-------------------------|
23+
| [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 |
24+
| [RStudio](https://www.rstudio.com) | [Link](https://www.rstudio.com/products/rstudio/download/#download) | | Linux, MacOS | GUI for R |
3225

3326
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.
3427

35-
### GDAL, GEOS, and PROJ.4
36-
37-
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.
38-
39-
:::::::::::::::: spoiler
40-
28+
::: spoiler
4129
## Windows
4230

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

45-
:::::::::::::::::::::::::
46-
47-
:::::::::::::::: spoiler
48-
34+
::: spoiler
4935
## macOS - Install with Packages (Beginner)
5036

5137
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`.
5238

5339
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.
40+
:::
5441

55-
:::::::::::::::::::::::::
56-
57-
:::::::::::::::: spoiler
58-
42+
::: spoiler
5943
## macOS - Install with Homebrew (Advanced)
6044

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

63-
```bash
47+
``` bash
6448
$ brew tap osgeo/osgeo4mac && brew tap --repair
6549
$ brew install proj
6650
$ brew install geos
6751
$ brew install gdal2
6852
```
53+
:::
6954

70-
:::::::::::::::::::::::::
71-
72-
:::::::::::::::: spoiler
73-
55+
::: spoiler
7456
## Linux
7557

7658
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).
7759

7860
For **Ubuntu**:
7961

80-
```bash
62+
``` bash
8163
$ sudo add-apt-repository ppa:ubuntugis
8264
$ sudo apt-get update
8365
$ sudo apt-get install libgdal-dev libgeos-dev libproj-dev
8466
```
8567

8668
For **Fedora**:
8769

88-
```bash
70+
``` bash
8971
$ sudo dnf install gdal-devel proj-devel geos-devel
9072
```
9173

9274
For **Arch**:
9375

94-
```bash
76+
``` bash
9577
$ pacman -S gdal proj geos
9678
```
9779

9880
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.
99-
100-
:::::::::::::::::::::::::
81+
:::
10182

10283
### UDUNITS
10384

10485
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.
10586

106-
:::::::::::::::: spoiler
107-
87+
::: spoiler
10888
## Linux
10989

11090
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).
11191

11292
For **Ubuntu**:
11393

114-
```bash
94+
``` bash
11595
$ sudo apt-get install libudunits2-dev
11696
```
11797

11898
For **Fedora**:
11999

120-
```bash
100+
``` bash
121101
$ sudo dnf install udunits2-devel
122102
```
123103

124104
For **Arch**:
125105

126-
```bash
106+
``` bash
127107
$ pacaur/yaourt/whatever -S udunits
128108
```
129109

130110
For **Debian**:
131111

132-
```bash
112+
``` bash
133113
$ sudo apt-get install -y libudunits2-dev
134114
```
135-
136-
:::::::::::::::::::::::::
115+
:::
137116

138117
### R
139118

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

142-
:::::::::::::::: spoiler
143-
121+
::: spoiler
144122
## Windows
145123

146124
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".
125+
:::
147126

148-
:::::::::::::::::::::::::
149-
150-
:::::::::::::::: spoiler
151-
127+
::: spoiler
152128
## macOS
153129

154130
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`.
131+
:::
155132

156-
:::::::::::::::::::::::::
157-
158-
:::::::::::::::: spoiler
159-
133+
::: spoiler
160134
## Linux
161135

162136
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.
163-
164-
:::::::::::::::::::::::::
137+
:::
165138

166139
### RStudio
167140

@@ -171,29 +144,28 @@ RStudio is a GUI for using `R` that is available for Windows, macOS, and various
171144

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

174-
- [`dplyr`](https://cran.r-project.org/package=dplyr)
175-
- [`ggplot2`](https://cran.r-project.org/package=ggplot2)
176-
- [`raster`](https://cran.r-project.org/package=raster)
177-
- [`rgdal`](https://cran.r-project.org/package=rgdal)
178-
- [`rasterVis`](https://cran.r-project.org/package=rasterVis)
179-
- [`remotes`](https://cran.r-project.org/package=remotes)
180-
- [`sf`](https://cran.r-project.org/package=sf)
147+
- [`dplyr`](https://cran.r-project.org/package=dplyr)
148+
- [`ggplot2`](https://cran.r-project.org/package=ggplot2)
149+
- [`raster`](https://cran.r-project.org/package=raster)
150+
- [`rgdal`](https://cran.r-project.org/package=rgdal)
151+
- [`rasterVis`](https://cran.r-project.org/package=rasterVis)
152+
- [`remotes`](https://cran.r-project.org/package=remotes)
153+
- [`sf`](https://cran.r-project.org/package=sf)
181154

182-
To install these packages in RStudio, do the following:
183-
1\. Open RStudio by double-clicking the RStudio application icon. You should see
184-
something like this:
155+
To install these packages in RStudio, do the following:\
156+
1. Open RStudio by double-clicking the RStudio application icon. You should see something like this:
185157

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

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

190-
```r
162+
``` r
191163
install.packages(c("dplyr", "ggplot2", "raster", "rgdal", "rasterVis", "sf"))
192164
```
193165

194166
You should see a status message starting with:
195167

196-
```output
168+
``` output
197169
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/dplyr_0.7.6.tgz'
198170
Content type 'application/x-gzip' length 5686536 bytes (5.4 MB)
199171
==================================================
@@ -207,7 +179,7 @@ downloaded 3.4 MB
207179

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

210-
```output
182+
``` output
211183
The downloaded binary packages are in
212184
/var/folders/7g/r8_n81y534z0vy5hxc6dx1t00000gn/T//RtmpJECKXM/downloaded_packages
213185
```
@@ -222,24 +194,21 @@ This option involves downloading an Docker image that contains an installation o
222194

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

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

227199
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.
228200

229-
:::::::::::::::: spoiler
230-
201+
::: spoiler
231202
## Downloading and Installing Docker Community Edition
232203

233204
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).
234205

235206
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.
236207

237208
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/).
209+
:::
238210

239-
:::::::::::::::::::::::::
240-
241-
:::::::::::::::: spoiler
242-
211+
::: spoiler
243212
## Using the `rocker/geospatial` Docker Image via the Command Line
244213

245214
#### Download and Set-up
@@ -248,23 +217,23 @@ Once Docker is installed and up and running, you will need to open your computer
248217

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

251-
```bash
220+
``` bash
252221
$ docker pull rocker/geospatial
253222
```
254223

255224
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.
256225

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

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

263232
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).
264233

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

267-
```bash
236+
``` bash
268237
$ docker port gis
269238
```
270239

@@ -274,30 +243,28 @@ An output, for example, of `8787/tcp -> 0.0.0.0:32768` would indicate that you s
274243

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

277-
```bash
246+
``` bash
278247
$ docker stop gis
279248
```
280249

281250
#### Re-starting a Container
282251

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

285-
```bash
254+
``` bash
286255
$ docker start gis
287256
```
288257

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

291-
```bash
260+
``` bash
292261
$ docker ps -a
293262
```
294263

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

297-
:::::::::::::::::::::::::
298-
299-
:::::::::::::::: spoiler
300-
267+
::: spoiler
301268
## Using the `rocker/geospatial` Docker Image via Kitematic
302269

303270
#### Download and Install Kitematic
@@ -308,17 +275,17 @@ If you are returning to a session after stopping Docker itself, make sure Docker
308275

309276
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.
310277

311-
![](/fig/kitematicSearch.png)
278+
![](fig/kitematicSearch.png)
312279

313280
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.
314281

315-
![](/fig/kitematicLocal.png)
282+
![](fig/kitematicLocal.png)
316283

317284
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.
318285

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

321-
![](/fig/kitematicURL.png)
288+
![](fig/kitematicURL.png)
322289

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

@@ -327,37 +294,32 @@ Paste that url into your browser and, if prompted, enter `rstudio` for both the
327294
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.
328295

329296
You can restart your container later by clicking the `Restart` button.
297+
:::
330298

331-
:::::::::::::::::::::::::
332-
333-
:::::::::::::::: spoiler
334-
299+
::: spoiler
335300
## Managing Docker Containers and Images
336301

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

339-
```bash
304+
``` bash
340305
$ docker ps -a
341306
```
342307

343308
To list all of the currently downloaded Docker images:
344309

345-
```bash
310+
``` bash
346311
$ docker images -a
347312
```
348313

349314
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`:
350315

351-
```bash
316+
``` bash
352317
$ docker system prune
353318
```
354319

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

357-
```bash
322+
``` bash
358323
$ docker system prune -a
359324
```
360-
361-
:::::::::::::::::::::::::
362-
363-
325+
:::

0 commit comments

Comments
 (0)