Spatial vector data
- Vector data represent discrete objects in space
- Points
- Single coordinates: $(x,y)$ or (longitude, latitude)
- Examples: locations of sampling sites, GPS positions of animals, monitoring stations for air quality
- Lines
- Connected sequence of points
- Examples: rivers and streams, roads and railway lines, animal migration tracks
- Polygons
- Closed shapes (boundaries with an inside and outside)
- Examples: country or county boundaries, nature reserves, lakes, forest stands
- Vector data structure
- Geometry: describes the shape and location (point/line/polygon)
- Attributes: data attached to each geometry
- Example: for a polygon representing a county, attributes are name, population, average income, disease rate
- Vector data are often handled with
sf (“simple features”)
- Stored like a data frame, but with a special geometry column
- Each row = one feature (one point, line, or polygon)
- Other columns = attributes (e.g. species, ID, measurement)


Raster data
- Raster data represent continuous surfaces as a grid of cells (pixels)
- Raster structure
- The study area is divided into regular cells
- Each cell covers the same area on the ground
- Each cell has one value
- Examples: elevation, temperature, land cover class
- Resolution
- Size of each cell on the ground
- Examples: 10 m × 10 m, 1 km × 1 km
- Smaller cells → higher resolution → more detail, but larger file size
- Extent
- The spatial area covered by the raster