Presentation "Geocomputation with R’s guide to reproducible spatial data analysis" - OpenGeoHub summer school 2022

  • By Jakub Nowosad
  • Last update: Aug 29, 2022
  • Comments: 1

Geocomputation with R’s guide to reproducible spatial data analysis

2022-08-30, OpenGeoHub Summer School 2022, Siegburg

Stan Openshaw defined in 2000 that "GeoComputation is about using the various different types of geodata and about developing relevant geo-tools within the overall context of a ‘scientific’ approach". In subsequent years, the idea of geocomputation gained much traction, with many new spatial data models, spatial data sources, geocomputation methods, and spatial visualizations. At the time of making the above definition, it was unrealistic to expect people to reproduce or replicate code examples automatically. Gladly, in addition to the geocomputation developments, we have seen a growing interest in reproducibility in many fields, including geocomputation. Reproducibility has many advantages, as it promotes the use of best practices, improves transparency and reusability, and allows for sharing the code and code workflows. The goal of this tutorial is to: a) provide an introduction to basic concepts of geocomputation, geocomputation with R, and reproducibility, and b) show various approaches and tools that allow for reproducibility and replicability, including R scripts, RStudio projects, {reprex}, {renv}, Git, Docker, and more. The tutorial will be a mixture of theoretical and practical: each concept will be first described and explained, and next, the attendees will have a chance to solve problems related to geocomputation with R and reproducibility of geospatial analysis.

Github

https://github.com/Nowosad/ogh2022

Comments(1)

  • 1

    test_reprex

    library(sf)
    #> Error in library(sf): es gibt kein Paket namens 'sf'
    library(terra)
    #> Error in library(terra): es gibt kein Paket namens 'terra'
    library(dplyr)
    #> Error in library(dplyr): es gibt kein Paket namens 'dplyr'
    library(spData)
    #> Error in library(spData): es gibt kein Paket namens 'spData'
    library(rgeoboundaries)
    #> Error in library(rgeoboundaries): es gibt kein Paket namens 'rgeoboundaries'
    library(tmap)
    #> Error in library(tmap): es gibt kein Paket namens 'tmap'
    library(supercells)
    #> Error in library(supercells): es gibt kein Paket namens 'supercells'
    
    germany = geoboundaries(country = "Germany")
    #> Error in geoboundaries(country = "Germany"): konnte Funktion "geoboundaries" nicht finden
    myurl = "/vsicurl/https://zenodo.org/record/6011200/files/clm_snow.cover_esa.modis_p05_1km_s0..0cm_2019.12_epsg4326_v1.tif"
    snow_cover = rast(myurl)
    #> Error in rast(myurl): konnte Funktion "rast" nicht finden
    germany_repr = st_transform(germany, crs(snow_cover))
    #> Error in st_transform(germany, crs(snow_cover)): konnte Funktion "st_transform" nicht finden
    
    
    snow_cover_croped = crop(snow_cover, germany_repr)
    #> Error in crop(snow_cover, germany_repr): konnte Funktion "crop" nicht finden
    
    
    germany_repr_loc = st_transform(germany_repr, 4839)
    #> Error in st_transform(germany_repr, 4839): konnte Funktion "st_transform" nicht finden
    snow_cover_croped_loc = project(snow_cover_croped, "epsg:4839")
    #> Error in project(snow_cover_croped, "epsg:4839"): konnte Funktion "project" nicht finden
    
    
    tm = tm_shape(snow_cover_croped_loc) + 
      tm_raster(style = "cont", title = "Snowfall") +
      tm_shape(germany_repr_loc) +
      tm_borders() + 
      tm_compass() +
      tm_scale_bar() + 
      tm_grid()
    #> Error in tm_shape(snow_cover_croped_loc): konnte Funktion "tm_shape" nicht finden
    

    Created on 2022-08-30 with reprex v2.0.2