You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***Value tool:** A MUST if you work with raster data. use this to view the value of a pixel in a raster dataset like you would the identify tool in ArcMap.
75
66
***MapSwipeTool:** A cool tool if you want to view before/ after rasters and look at differences.
@@ -79,4 +70,4 @@ line access to the tool.
79
70
80
71
## Challenge
81
72
82
-
If there's time...create a map of the Gulf of mexico.
Copy file name to clipboardExpand all lines: spatial-data-gis-law/3-mon-intro-gis-in-r.Rmd
+17-19Lines changed: 17 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -23,17 +23,17 @@ At the end of this 30 minute overview you will be able to:
23
23
24
24
## Work with vector data in R
25
25
26
-
<ahref="https://earthdatascience.org/course-materials/earth-analytics/week-4/intro-vector-data-r/"target="_blank">Intro to vector data in R - Earth Data Science website</a>
26
+
<ahref="https://earthdatascience.org/courses/earth-analytics/spatial-data-r/intro-vector-data-r/"target="_blank">Introduction to vector data in R - Earth Data Science website</a>
27
27
28
-

28
+

29
29
30
30
There are many ways to import and map vector data in R.
31
31
32
32
To read the data, you have several options
33
33
34
34
*`sp`: Import shapefiles and other data using `readOGR()` from the `sp` package
35
35
*`sp`: more recently the `sf` package has proved to be both faster and more efficient that `sp`
36
-
* if you have geojson data - there are several json packages that you can use - check out <ahref="https://earthdatascience.org/course-materials/earth-analytics/week-10/co-water-data-spatial-r/">this tutorial on dealing with geojson imported from API's in R if you're interested in learning more</a>.
36
+
* if you have geojson data - there are several json packages that you can use - check out <ahref="https://earthdatascience.org/courses/earth-analytics/week-10/co-water-data-spatial-r/">this tutorial on dealing with geojson imported from API's in R if you're interested in learning more</a>.
@@ -361,8 +361,8 @@ base plot pros: faster maps, more difficult
361
361
362
362
| Tool | Pros | Cons |
363
363
|---|---|---|---|---|
364
-
| ggplot() | templated maps, easy to standardize, clean mapping code, simple fast legends | need to convert sp objects from `readOGR()` to a data frame |
365
-
| BASE R plot() | faster mapping, supports sp objects natively | legends are tedious to create and customize |
364
+
|`ggplot()`| templated maps, easy to standardize, clean mapping code, simple fast legends | need to convert sp objects from `readOGR()` to a data frame |
365
+
| BASE R `plot()`| faster mapping, supports sp objects natively | legends are tedious to create and customize |
366
366
||||
367
367
===
368
368
@@ -383,7 +383,7 @@ plot(gulf_study_area_wgs84,
383
383
384
384
Finally it is always nice to create interactive maps. This allows your
385
385
colleagues to not only see but also interact with your data.
386
-
Let's use mapview() to create a quick interactive map.
386
+
Let's use `mapview()` to create a quick interactive map.
387
387
388
388
To use mapview with multpile layers, you simply create a mapview
389
389
object for each layer and then add them together to produce a final plot.
@@ -419,14 +419,14 @@ community around it and is a standard for most raster operations in `R`.
419
419
420
420
To load a raster layer with a single band - we use `raster()`.
A raster layer can have one or depending on the format more than 1 band of information stored within it. Sometimes those bands are for images (see below) and will be RGB or in the case of a multi or hyperspectral
425
425
remote sensing instrument - hundreds of bands across the light spectrum.
426
426
427
427
Sometimes those bands will be time series (for example climate data which we will work with tomorrow).
We can open an .asc layer using the raster() function. Note that this
444
+
We can open an `.asc` layer using the `raster()` function. Note that this
445
445
same process can be used with geotiffs and many other raster formats.
446
446
The raster package is adept at figuring out what format of data you are
447
447
providing it and using the correct drivers to open and read in the data!
448
448
449
-
The raster package also has a wrapper around the base plot() function
449
+
The raster package also has a wrapper around the base `plot()` function
450
450
allowing us to plot data using the same approach that we used above!
451
451
452
452
```{r}
@@ -516,7 +516,7 @@ plot(coastlines_crop,
516
516
517
517
## when rasters don't line up
518
518
519
-
we can use the projectRaster() function to reproject raster data in the same way we use spTransform() with
519
+
we can use the `projectRaster()` function to reproject raster data in the same way we use spTransform() with
520
520
vector data.
521
521
522
522
@@ -592,7 +592,7 @@ plot(us_states,
592
592
593
593
## Static basemaps in R
594
594
595
-
You can also create static basemaps quickly in R. Below we use ggmap()
595
+
You can also create static basemaps quickly in `R`. Below we use `ggmap()`
596
596
to create a basemap for a particular lat/long location.
597
597
598
598
```{r}
@@ -603,8 +603,8 @@ library(ggmap)
603
603
604
604
Let's create a basemap!
605
605
606
+
<ahref="https://earthdatascience.org/courses/earth-analytics/lidar-raster-data-r/ggmap-basemap/"target="_blank">Create basemaps with ggmap in R - Earth Data Science website </a>
0 commit comments