Geospatial Data Science and Economic Spatial Models

Bruno Conte | bruno.conte@bse.eu | Course GitHub repo here
Barcelona School of Economics

Overview

This course introduces the basics for working with geospatial data: datasets that reflect geographical features of the reality. Using R (and Rstudio) as the main programming platform, and sf as the main package, students by the end of the course are expected to achieve the following objectives:

  • Identify sources of (and retrieve) different types of geospatial data from standard databases or the web

  • Manipulate raw spatial data (i.e. data wrangle) into the structure that fits the desired analysis/application

  • Visualize geospatial data in static and interactive frameworks (i.e. maps and dashboards)

  • Implement basic concepts of economic spatial models (e.g. optimal route choices, optimal transportation networks) in real applications by linking geospatial data to these models

  • Document results with reproduceable markdown reports

All practical applications are taking place in R and RStudio. Please have both installed in your computer and follow these setup instructions before starting the course.

Course structure

This is a 20 hours course, divided in ten sessions of 2 hours each. Its overall structure is divided in three parts as follows:

Part 1: Introduction, vector data, and basic spatial analysis

  • Session 1: Introduction to geospatial data and applications in business and research

    • Basic aspects of R (tidyverse, ggplot2), spatial data, and applications in economic research

    • Class slides here and hands-on material here

  • Session 2: Vector spatial data (points, lines, and polygons)

    • Creating, loading, and manipulating vector data with sf

    • Spatial (re)projections and basic data visualization with ggplot2

    • Class slides here and hands-on material here

  • Session 3: Attribute- and spatial-based operations with vector data

    • Operations with vector data: attribute-based (e.g. filter(), slice()) and spatial-based (e.g. st_intersects(), st_overlaps(), st_touches(), st_join(), aggregate())

    • Class slides here and hands-on material here

    • Assignment: reproducing operations with proposed data and replicating results from academic papers. Instructions here

  • Session 4: Geometry-based operations with vector data

    • Unary operations (e.g., simplification, centroids, buffers, casting)

    • Binary operations (e.g., clipping, subsetting, calculating distances)

    • Class slides here and hands-on material here

    • Class follow-up: feedback on course pace, reinforcing concepts, etc.

    • Assignment: Produce maps and statistics (histograms, correlations) with real-world spatial data. Instructions html

Part 2: Raster (image) data and interactive data visualization

  • Session 5: Raster basics

    • Basic differences between raster (image) and vector data

    • Creating raster data with terra

    • Unary raster operations (e.g. crop and vectorize)

    • Class slides here and hands-on material here

  • Session 6: Raster-vector operations

    • Basic differences between raster (image) and vector data

    • Creating raster data with terra

    • Unary raster operations (e.g. crop and vectorize)

    • Class slides here and hands-on material here

  • Session 7: Interactive tools

    • Basic of interactive dashboards using leaflet + APIs

    • Class slides here and hands-on material here

Part 3: Spatial models in economics and real-world applications

  • Session 8: Economic spatial models and real-world applications

    • Introduction to spatial models and applications to academic research

    • Class slides here and hands-on material here

  • Session 9: Linking models to (spatial) data

    • Conceptual and practical issues when linking real-world (geospatial) data to a spatial model of migration

    • Class slides here and hands-on material here

  • Session 10: Models, data, and counterfactual simulations

    • Applications of spatial models (combined with spatial data) when answering counterfactual questions

    • Class slides here and hands-on material here

References

  • Donaldson, D. and Storeygard, A., 2016. The view from above: Applications of satellite data in economics. Journal of Economic Perspectives, 30(4), pp.171-98.

  • Lovelace, R., Nowosad, J. and Muenchow, J., 2019. Geocomputation with R. Chapman and Hall/CRC.

  • Pebesma, E., 2018. Simple Features for R: Standardized Support for Spatial Vector Data. The R Journal, 10 (1), 439-446, https://doi.org/10.32614/RJ-2018-009

  • Wickham, H. and Grolemund, G., 2016. R for data science: import, tidy, transform, visualize, and model data. ” O’Reilly Media, Inc.”.