3 Geospatial Data

3.2 Packages used

  • sp, sf for vector geospatial data
  • raster, terra for raster geospatial data

3.3 Spatial data have spatial reference

  • coordinate values (e.g. XY, XYZ)
  • a system of reference for these coordinates (e.g. WGS84)

All spatial data consist of positional information, answering the question ‘where is it?’.
In many applications these will be extended by attributes, answering the question ‘what is where?’

3.4 Spatial data models

    Vector data models

  • Point: a single point location, such as a GPS reading or a geocoded address
  • Line: a set of ordered points, connected by straight line segments
  • Polygon: an area, marked by one or more enclosing lines, possibly containing holes, with no lines intersecting
  • Raster data model

  • Grid: a collection of points or rectangular cells, organised in a regular lattice

3.4.1 Vector vs Raster data models

Vector and Raster data

Figure 3.1: Vector and Raster data

Example of representation using a vector and a raster data models:
A river and a tree represented using a vector or a raster data model.

Figure 3.2: A river and a tree represented using a vector or a raster data model.