Introduction to GIS with R / Presentation and use case for the Canton of Zurich | Read-only mirror of https://github.com/statistikZH/gisR — Kanton Zürich. Issues & pull requests at the source.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-07-10 17:52:01 +02:00
extdata move to dedicated spot 2024-07-10 11:25:59 +02:00
img rerun 2024-07-10 17:52:01 +02:00
R place for functions 2024-07-10 11:26:10 +02:00
scripts getGeodata: source bbox function 2024-07-10 13:59:43 +02:00
.gitignore gitignore: presi files, geodata folder 2024-07-08 11:26:10 +02:00
.Rbuildignore init project 2024-06-27 13:20:22 +02:00
DESCRIPTION init project 2024-06-27 13:20:22 +02:00
gisR.Rproj native pipe, self-contained html, presentation 2024-07-08 20:47:18 +02:00
LICENSE Initial commit 2024-06-27 13:16:19 +02:00
NAMESPACE init project 2024-06-27 13:20:22 +02:00
praesentation.html rerun 2024-07-10 17:52:01 +02:00
praesentation.qmd rerun 2024-07-10 17:52:01 +02:00
README.md update readme 2024-07-10 11:32:34 +02:00

gisR

Introduction to GIS with R / Presentation and use case for the Canton of Zurich

How to set up the project

It is suggested to use RStudio to run this project.

  1. First clone the repository as described in the linked manual.

  2. Go to scripts/00_setup.R and run it (it installs the needed packages and loads the functions)

Scripts

Run the scripts before knitting the presentation. Some files that are downloaded/calculated within the scripts are used by the quarto.

├── 00_setup.R
├── 01_dlFromSTAC.R
├── 02_getGeodata.R
├── 03_loadSaveRasters.R
├── 04_calculateNDVI.R
├── 05_statistics.R
  • 01_dlFromSTAC
    Download Band 2-4 & 8 of the Sentinel-2 scene S2B_MSIL2A_20230613T102609_R108_T32TMT_20230613T173356

  • 02_getGeodata
    Download Layers from a WFS Server

    • Landwirtschaftliche Nutzflächen
    • Bezirke
    • Gemeindegrenzen
    • Kantonsgrenze Kt. ZH
  • 03_loadSaveRasters
    Combine 4 Bands to a single 4-band Raster, project it to EPSG:2056 and save to file.

  • 04_calculateNDVI
    Load a 4 Band tif file, calculate the NDVI according to:

    $$NDVI = \frac{(NIR - RED)}{(NIR + RED

    and save it to file.

  • 05_statistics
    From the NDVI raster and a polygon layer, calculate the mean NDVI per feature, indicating vegetation health per parcel.