alginCustomRaster: Align raster extent with template grid

View source: R/utility_functions.R

alginCustomRasterR Documentation

Align raster extent with template grid

Description

Align raster extent with template grid

Usage

alginCustomRaster(
  inputPath = "./MEWCustom/MEW_new.tif",
  RES = 75,
  CRS = "epsg:3111",
  EXTENT = c(2126550, 2941050, 2258825, 2828075),
  outPath = NULL
)

Arguments

inputPath

the path to the raster to be processed to match template grid

RES

the Resolution of the template grid ( units depend on CRS) for FAME it will be 75 0r 225 metres

CRS

in form acceptable for terra::crs() function of default VicGrid94 given as "epsg:3111"

EXTENT

extent of the template raster as vector giving xmin ,ymin xmax,ymax in same units as resolution.

outPath

path to ouptut file to (folder path) if null then file is output to same directory as input with RES_cutom.tif appended to filename

Value

outputRaster of same extent, resolution and CRS as the template settings

Examples

 terra::writeRaster(terra::rast(matrix(10,10,10),ext=c(143,143.3,-36,-35.7),crs="epsg:4283" ),"temp.tif",overwrite=TRUE)
 alginCustomRaster(inputPath ="./temp.tif", RES =  75, CRS="epsg:3111",EXTENT = c(2126550, 2941050, 2258825, 2828075 ))
 unlink("./temp_75_custom.tif")
 unlink("temp.tif")

nevilamos/FAMEFMR documentation built on April 17, 2025, 9:32 p.m.