https://github.com/ucdavisdatalab/workshop_coordinate_reference_systems
DEPRECIATED - This workshop discusses coordinate reference systems (projections) and gives examples in R. It can be expanded to give examples in other tools.
https://github.com/ucdavisdatalab/workshop_coordinate_reference_systems
coordinate-reference-system gis gis-data projections r spatial-data
Last synced: 4 months ago
JSON representation
DEPRECIATED - This workshop discusses coordinate reference systems (projections) and gives examples in R. It can be expanded to give examples in other tools.
- Host: GitHub
- URL: https://github.com/ucdavisdatalab/workshop_coordinate_reference_systems
- Owner: ucdavisdatalab
- Created: 2021-04-21T19:00:03.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-21T19:08:17.000Z (almost 3 years ago)
- Last Synced: 2024-01-29T20:42:12.200Z (over 2 years ago)
- Topics: coordinate-reference-system, gis, gis-data, projections, r, spatial-data
- Language: R
- Homepage: https://ucdavisdatalab.github.io/workshop_coordinate_reference_systems/
- Size: 21.3 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**UPDATE:** This workshop is no long being developed here. Please use the [Projections Workshop](https://github.com/ucdavisdatalab/workshop-projections) instead.
# Workshop: Coordinate Reference Sytems
_[UC Davis DataLab](https://datalab.ucdavis.edu/)_
_Spring 2021_
_Instructor: Michele Tobias, PhD <>_
* [Reader](https://ucdavisdatalab.github.io/workshop_coordinate_reference_systems/)
* [Event Page](https://datalab.ucdavis.edu/eventscalendar/maptimedavis-projected-coordinate-systems-in-r/)
## Description
In this workshop, participants will learn about projected coordinate reference systems (CRS, commonly called “projections”) and how to apply them in R to spatial data. We will discuss the components of a CRS, how to apply them, how to translate your data into a different CRS, and how to choose a CRS.
## Learning Objectives
By the end of this workshop, participants will have a better understanding of what a projected coordinate system is, why you would choose one over another, and how to apply them correctly to geospatial data in R.
## Prerequisites
Participants should have a basic understanding of R (for example, be able to create variables and load common data formats like a CSV) and a basic understanding of GIS data formats (e.g., raster and vector data). Participants should also install R and RStudio.
## Contributing
The course reader is a live webpage, hosted through GitHub, where you can enter
curriculum content and post it to a public-facing site for learners.
To make alterations to the reader:
1. Run `git pull`, or if it's your first time contributing, see
[Setup](#setup).
2. Edit an existing chapter file or create a new one. Chapter files are R
Markdown files (`.Rmd`) at the top level of the repo. Enter your text,
code, and other information directly into the file. Make sure your file:
- Follows the naming scheme `##_topic-of-chapter.Rmd` (the only exception
is `index.Rmd`, which contains the reader's front page).
- Begins with a first-level header (like `# This`). This will be the title
of your chapter. Subsequent section headers should be second-level
headers (like `## This`) or below.
- Uses caching for resource-intensive code (see [Caching](#caching)).
Put any supporting resources in `data/` or `img/`. For large files, see
[Large Files](#large-files). You do not need to
add resources generated by your R code (such as plots). The knit step saves
these in `docs/` automatically.
3. Run `knit.R` to regenerate the HTML files in the `docs/`. You can do this
in the shell with `./knit.R` or in R with `source("knit.R")`.
4. Run `renv::snapshot()` in an R session at the top level of the repo to
automatically add any packages your code uses to the project package
library.
5. When you're finished, `git add`:
- Any files you added or edited directly, including in `data/` and `img/`
- `docs/` (all of it)
- `_bookdown_files/` (contains the **knitr** cache)
* `renv.lock` (contains the **renv** package list)
- `.gitattributes` (contains the Git LFS file list)
Then `git commit` and `git push`. The live web page will update
automatically after 1-10 minutes.
### Caching
If one of your code chunks takes a lot of time or memory to run, consider
caching the result, so the chunk won't run every time someone knits the
reader. To cache a code chunk, add `cache=TRUE` in the chunk header. It's
best practice to label cached chunks, like so:
````
```{r YOUR_CHUNK_NAME, cache=TRUE}
# Your code...
```
````
Cached files are stored in the `_bookdown_files/` directory. If you ever want
to clear the cache, you can delete this directory (or its subdirectories).
The cache will be rebuilt the next time you knit the reader.
Beware that caching doesn't work with some packages, especially packages that
use external libraries. Because of this, it's best to leave caching off for
code chunks that are not resource-intensive.
### Large Files
If you want to include a large file (say over 1 MB), you should use git LFS.
You can register a large file with git LFS with the shell command:
```sh
git lfs track YOUR_FILE
```
This command updates the `.gitattributes` file at the top level of the repo. To
make sure the change is saved, you also need to run:
```sh
git add .gitattributes
```
Now that your large is registered with git LFS, you can add, commit, and push
the file with git the same way you would any other file, and git LFS will
automatically intercede as needed.
GitHub provides 1 GB of storage and 1 GB of monthly bandwidth free per repo for
large files. If your large file is more than 50 MB, check with the other
contributors before adding it.
## Setup
### Git LFS
This repo uses [Git Large File Storage][git-lfs] (git LFS) for large files. If
you don't have git LFS installed, [download it][git-lfs] and run the installer.
Then in the shell (in any directory), run:
```sh
git lfs install
```
Then your one-time setup of git LFS is done. Next, clone this repo with `git
clone`. The large files will be downloaded automatically with the rest of the
repo.
[git-lfs]: https://git-lfs.github.com/
### R Packages
This repo uses [**renv**](https://rstudio.github.io/renv/) for package
management. Install **renv** according to the installation instructions on
their website.
Then open an R session at the top level of the repo and run:
```r
renv::restore()
```
This will download and install the correct versions of all the required
packages to **renv**'s package library. This is separate from your global R
package library and will not interfere with other versions of packages you have
installed.
[Back to Top](#top)