FOSS4G 2022 workshops

Modernizing the R-GRASS interface: confronting barn-raised OSGeo libraries and the evolving R.*spatial package ecosystem
08-22, 16:15–18:15 (Europe/Rome), 212

Introduces the current status of the R R-GRASS GISS interface package "rgrass". There are two operation modes, starting R in a running GRASS session in an existing GRASS location, or starting a fresh GRASS session from R. All GRASS commands and most GRASS extensions can be scripted from R.


We'll show different ways to connect R and GRASS, and different ways to read and write especially raster data via chosen R packages , their advantages and disadvantages. There have been many changes in the OSGeo library ecosystem used both by GRASS GIS and R.spatial packages (https://r-spatial.org, https://rspatial.org), so the tutorial will introduce the interface to those for whom it is new, and update users of the interface on ongoing changes related to changes both in the OSGeo library ecosystem and the R.spatial package ecosystem.

Examples will include using GRASS GIS functionality to extend what is feasible in R alone when handling and analysing spatial data, and using R as an alternative to Python for scripting GRASS GIS commands.

Information on the versions of GRASS, R and R packages which should be installed on participants' computers will be provided, together with a simple test to check that installation has succeeded. Participant's computers should have recent GRASS and R pre-installed, and the instructions at the start of the online workshop document should be followed before reaching Florence. Data sets and code will also be provided linked from the workshop document. Files will be made available from the workshop document on https://rsbivand.github.io/foss4g_2022/modernizing_220822.html

Roger Bivand is an emeritus professor at the Norwegian School of Economics. His specialties are Geographical Information Analysis, Statistical programming and Spatial econometrics. Roger is author of numerous R packages and was the main author of the Applied Spatial Data Analysis with R book. He has worked on the R-GRASS interface for almost 25 years (see https://doi.org/10.1016/S0098-3004(00)00057-1 for the very beginning).