Spatial Data Science introduces fundamental aspects of spatial data that every data scientist should know before they start working with spatial data. These aspects include how geometries are represented, coordinate reference systems (projections, datums), the fact that the Earth is round and its consequences for analysis, and how attributes of geometries can relate to geometries. In the second part of the book, these concepts are illustrated with data science examples using the R language. In the third part, statistical modelling approaches are demonstrated using real world data examples. After reading this book, the reader will be well equipped to avoid a number of major spatial data analysis errors.

The book gives a detailed explanation of the core spatial software packages for R: sf for simple feature access, and stars for raster and vector data cubes – array data with spatial and temporal dimensions. It also shows how geometrical operations change when going from a flat space to the surface of a sphere, which is what sf and stars use when coordinates are not projected (degrees longitude/latitude). Separate chapters detail a variety of plotting approaches for spatial maps using R, and different ways of handling very large vector or raster (imagery) datasets, locally, in databases, or in the cloud. The data used and all code examples are freely available online from https://r-spatial.org/book/. The solutions to the exercises can be found here: https://edzer.github.io/sdsr_exercises/.

part I|70 pages

Spatial Data

chapter 1|12 pages

Getting Started

chapter 2|12 pages


chapter 3|16 pages


chapter 4|4 pages

Spherical Geometries

chapter 5|10 pages

Attributes and Support

chapter 6|12 pages

Data Cubes

part II|72 pages

R for Spatial Data Science

chapter 7|44 pages

Introduction to sf and stars

chapter 8|12 pages

Plotting spatial data

chapter 9|12 pages

Large data and cloud native

part III|116 pages

Models for Spatial Data

chapter 10|8 pages

Statistical modelling of spatial data

chapter 11|10 pages

Point Pattern Analysis

chapter 12|16 pages

Spatial Interpolation

chapter 14|18 pages

Proximity and Areal Data

chapter 15|24 pages

Measures of Spatial Autocorrelation

chapter 16|12 pages

Spatial Regression

chapter 17|14 pages

Spatial Econometrics Models