get_example_data: Get Example Multispectral SpatRaster

View source: R/data.R

get_example_dataR Documentation

Get Example Multispectral SpatRaster

Description

Returns a ready-to-use synthetic 6-band terra::SpatRaster for fast, reproducible examples and unit testing without downloading satellite scenes.

Usage

get_example_data()

Details

The raster is generated programmatically (10 x 10 pixels, 100 m x 100 m extent, EPSG:32631). It contains three simulated land-cover types: healthy vegetation (pixels 2-40), water (pixels 41-70), and built-up / bare soil (pixels 71-100). Pixel 1 is NA in all bands for boundary / NA-handling verification.

Spectral bands (reflectance 0-1):

  • blue: Blue (0.45 - 0.51 um)

  • green: Green (0.53 - 0.59 um)

  • red: Red (0.64 - 0.67 um)

  • nir: Near-infrared (0.85 - 0.88 um)

  • swir1: Short-wave infrared 1 (1.57 - 1.65 um)

  • swir2: Short-wave infrared 2 (2.11 - 2.29 um)

Value

A terra::SpatRaster with 6 layers named "blue", "green", "red", "nir", "swir1", "swir2".

Examples

img <- get_example_data()
print(img)
terra::nlyr(img)


GeoIndexR documentation built on Oct. 10, 2026, 5:08 p.m.