class: center, middle ![:scale 30%](/assets/images/coding_club_logo_1.png) # 26 FEBRUARY 2019 ## INBO coding club Herman Teirlinck
01.71 - Frans Breziers --- class: center, middle ![:scale 95%](/assets/images/20190226/20190226_coding_club_abstract_workshop_biodiversity_next.png)
[INBO Coding Club goes to Biodiversity_next (Leiden)](https://biodiversitynext.org/list-of-symposia-and-workshops/) --- class: center, middle ![:scale 90%](/assets/images/20190226/20190226_spatial_data.png) --- class: left, middle Install the package: ```r install.packages("sf") ``` Load the package: ```r library(sf) ``` --- class: center, middle ![:scale 90%](/assets/images/20190226/20190226_cheasheet.png)
[`sf` cheatsheet](https://github.com/inbo/coding-club/blob/master/cheat_sheets/20190226_cheat_sheet_sf.pdf) --- class: center, middle ### How to get started? Check the [Each session setup](https://inbo.github.io/coding-club/gettingstarted.html#each-session-setup) to get started. ### First time coding club? Check the [First time setup](https://inbo.github.io/coding-club/gettingstarted.html#first-time-setup) section to setup. --- class: center, middle ![:scale 100%](/assets/images/coding_club_sticky_concept.png) --- class: center, middle ### Share your code during the coding session! Go to https://hackmd.io/PbkFYUshQmS3pRdEZ6XJeg?both
--- background-image: url(/assets/images/background_challenge_1.png) class: left, middle # Challenge 1 - Download [`20190226/20190226_utm10_bel.zip`](https://github.com/inbo/coding-club/blob/master/data/20190226/20190226_utm10_bel.zip) in your folder `./data` and extract all in subfolder `./data/20190226/20190226_utm10_bel/` (via right-click). It contains the [EAA reference grid](https://www.eea.europa.eu/data-and-maps/data/eea-reference-grids-2) of Belgium at 10km resolution. - Download R file [`20190226/20190226_challenge_1.R`](https://github.com/inbo/coding-club/blob/master/src/20190226/20190226_challenge_1.R) and run it to get occurrences of Chinese mitten crabs in Belgium with valid coordinates. Challenge: 1. Read the reference grid with `sf` package. Check [documentation](https://r-spatial.github.io/sf/articles/sf2.html) on how to do it. 2. Create a `sf` data.frame, `spatial_crab_df`, from `crab_df` with CRS: `epsg=4326`, the CRS used by GBIF. Check [documentation](https://r-spatial.github.io/sf/articles/sf2.html). 3. Compare the CRS of occurrences and grid. Use the [`sf` cheat sheet](https://github.com/inbo/coding-club/blob/master/cheat_sheets/20190226_cheat_sheet_sf.pdf). --- class: left, middle ### CRS No geospatial data without specifying the Coordinate Reference System you work with!
See [video](https://youtu.be/KUF_Ckv8HbE) from [tutorial](https://www.earthdatascience.org/courses/earth-analytics/spatial-data-r/intro-to-coordinate-reference-systems/). --- background-image: url(/assets/images/background_challenge_2.png) class: left, middle # Challenge 2 1. How many occurrences of Chinese mitten crab in each cell from 2015? Hint: Use [`sf` cheat sheet](https://github.com/inbo/coding-club/blob/master/cheat_sheets/20190226_cheat_sheet_sf.pdf) to find how to *intersect* geometries. 2. Find the 5 cells with the highest number of occurrences. --- background-image: url(/assets/images/background_challenge_3.png) class: left, middle # Challenge 3 Download [`20190226/20190226_ps_hbtrl.zip`](https://github.com/inbo/coding-club/blob/master/data/20190226/20190226_ps_hbtrl.zip) in your folder `./data/` and extract all in subfolder `./20190226/20190226_ps_hbtrl` (via right-click). You have just downloaded the *Habitatrichtlijn(deel)gebieden* of Flanders. Source: [Habitatrichtlijn(deel)gebieden](https://www.geopunt.be/catalogus/datasetfolder/a84a87f5-5607-4019-a8db-9d52a827786b). Goal: 1. Read areas from first layer (`"ps_hbtrl"`) 2. Create a buffer of 1km around the protected areas. 3. How far is the nearest Chinese mitten crab for each area? --- class: center, middle ![:scale 100%](/assets/images/time_for_review.jpg) --- class: center, middle ![:scale 30%](/assets/images/coding_club_logo_1.png) Room: Herman Teirlinck - 01.71 - Frans Breziers
Date: 21/03/2019, van 10:00 tot 12:00
(registration announced via DG_useR@inbo.be)