alignRasters: Align Rasters

View source: R/align_rasters.R

alignRastersR Documentation

Align Rasters

Description

Aligns multiple rasters with a single reference raster. A raster will be aligned if it doesn't match the dimensions, resolution, extent, origin, or CRS projection of the reference raster.

Usage

alignRasters(referenceRaster = NULL, inputRasters = NULL)

Arguments

referenceRaster

A SpatRaster object to be aligned with.

inputRasters

A list of SpatRaster objects to align with the referenceRaster.

Details

Projecting a raster requires that its cell values be estimated in accordance with its new projection. Continuous variable rasters will use bilinear interpolation while categorical (factor) rasters will use nearest-neighbor sampling.

Value

A list of SpatRaster objects that share the same grid and projection as referenceRaster.

Author(s)

Tate Brasel https://github.com/tabrasel

Examples


#library(TerrainWorksUtils)
#
#referenceRaster <- terra::rast("C:/Work/netmapdata/Puyallup/elev_puy.flt")
#
#inputRasters <- list(
#   gradient = terra::rast("C:/Work/netmapdata/Puyallup/grad_15.tif"),
#   lithology = terra::rast("C:/Work/netmapdata/Puyallup/litho.tif")
# )
#
#alignedRasters <- alignRasters(referenceRaster, inputRasters)
#

elpidiofilho/mdsFuncs documentation built on April 14, 2022, 5:40 p.m.