forked from spatialanalysis/workshop-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
11-interpolation-aot.Rmd
63 lines (48 loc) · 2.41 KB
/
11-interpolation-aot.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Interpolation with Array of Things Data
## Overview
This workshop continues teaching interpolation in R using Array of Things data. This is based on Part 2 of the [Array of Things workshop](https://geodacenter.github.io/aot-workshop/) put together by Marynia Kolak at the CSDS.
## Download data
Please download data for this workshop by going to the [following link](https://github.com/spatialanalysis/workshop-notes/blob/master/data/node_temps.csv) and right-clicking on "Raw", then saving the link as a CSV on your computer.
Or, you can run the following code in your console:
```{r eval=FALSE}
download.file("https://github.com/spatialanalysis/workshop-notes/raw/master/data/node_temps.csv", destfile = "node-temps.csv")
```
Also download a copy of the Chicago Community Area data [here](https://data.cityofchicago.org/Facilities-Geographic-Boundaries/Boundaries-Community-Areas-current-/cauq-8yn6), or use the API Endpoint (copy and paste into your console).
```{r}
library(sf)
areas <- st_read("https://data.cityofchicago.org/resource/igwz-8jzy.geojson")
```
```{block type="learncheck"}
**Challenge**
```
Read in the csv as an sf object, then explore it using exploratory data functions like `head()`, `str()`, `summary()`, and `plot()`
```{block type="learncheck"}
```
```{block type="learncheck"}
**Challenge**
```
Try making a map of the nodes, with the community areas, using `ggplot2`.
```{block type="learncheck"}
```
```{block type="learncheck"}
**Challenge**
```
Convert the sf object into an sp object. Hint: `as_Spatial(sf)` should do the trick.
```{block type="learncheck"}
```
```{block type="learncheck"}
**Challenge**
```
Make an empirical variogram of the data.
```{block type="learncheck"}
```
```{block type="learncheck"}
**Challenge**
```
Krige! Try out a few types of models: spherical, exponential, and linear.
```{block type="learncheck"}
```
## Links
- When you can't find great R documentation of concepts, ArcGIS documentation will do: [Semivariogram and covariance functions](https://pro.arcgis.com/en/pro-app/help/analysis/geostatistical-analyst/semivariogram-and-covariance-functions.htm)
- Alternate explanation of how to interpolate with kriging (also uses proprietary GIS software): [Kriging interpolation](https://gisgeography.com/kriging-interpolation-prediction/)
- [Variogram tutorial](http://www.goldensoftware.com/variogramTutorial.pdf) that provides some good, clear explanation of complicated concepts