No, not this time!
![:scale 80%](/assets/images/20200326/20200326_cheatsheet_challenge1.png) --- class: left, middle ### CRS No geospatial data without specifying the Coordinate Reference System you work with! Why? Because we need to project a sphere on a flat map! The typical Mercator projection stretches at the Poles: ![:scale 80%](/assets/images/20200326/20200326_greenland_vs_africa.png). For more strange effects of the mercator projection see this [video](https://youtu.be/KUF_Ckv8HbE) from [tutorial](https://www.earthdatascience.org/courses/earth-analytics/spatial-data-r/intro-to-coordinate-reference-systems/). --- class: left, middle ### CRS by EPSG codes A common way to specify the CRS is by providing the EPSG code. EPSG stands for European Petroleum Survey Group and is an organization that maintains a geodetic parameter database with standard codes, the EPSG codes, for coordinate systems, datums, spheroids, units and such alike. There are a lot of EPSG codes! Full list: https://spatialreference.org/ ![:scale 80%](/assets/images/20200326/20200326_epsg_codes.png) --- background-image: url(/assets/images/background_challenge_2.png) class: left, middle # Challenge 2 1. For each observation of Atalanta find the 10x10km cell it belongs to. Hint: an `intersection` is needed... 2. How many observations in each cell of the grid? 3. For each observation of Atalanta find the municipality it belongs to. 4. How many observations in each municipality?
![:scale 80%](/assets/images/20200326/20200326_cheatsheet_challenge2.png) --- background-image: url(/assets/images/background_challenge_3.png) class: left, middle # Challenge 3 1. Get information on the layers of the Flemish protected area. How are they called? 2. Read the layer `ps_hbtrl` of the Flemish protected areas as `hab_flanders`. Does it have a EPSG code? If not, *transform* to EPSG code 31370 ( [geopunt source](https://www.geopunt.be/catalogus/datasetfolder/a84a87f5-5607-4019-a8db-9d52a827786b)) 3. Overlap protected areas and municipalities 4. In which municipalities is *Kalmthoutse Heide* located? 5. And the *Voerstreek*?
![:scale 80%](/assets/images/20200326/20200326_cheatsheet_challenge3.png) --- class: left, middle # Bonus challenge Some extra exercises... 1. Via `st_read()` you can also read shape files! Go to the zipped shape file of Flemish protected areas: [`20190226/20190226_ps_hbtrl.zip`](https://github.com/inbo/coding-club/blob/master/data/20190226/20190226_ps_hbtrl.zip). Download it in your `data` folder and extract in subfolder `data/20190226/20190226_ps_hbtrl`. Check the names of the layers and read the layer `ps_hbtrl` as in challenge 3 2. Calculate centroids of the municipalities 3. Calculate distance of Atalanta observations to the centroids of the municipalities --- class: left, middle # Resources - [Geocomputation with R](https://geocompr.robinlovelace.net/) - [Spatial Data Science](https://keen-swartz-3146c4.netlify.com/) - [How to use open vector file formats in R](https://inbo.github.io/tutorials/tutorials/spatial_standards_vector/) - [`sf` cheatsheet](https://github.com/inbo/coding-club/blob/master/cheat_sheets/20200326/20200326_cheat_sheet_sf.pdf) - [`sf` article with some examples](https://r-spatial.github.io/sf/articles/sf2.html) --- 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.05 - Isala Van Diest Date: 28/04/2020, van 10:00 tot 12:00 (registration announced via DG_useR@inbo.be)