reproject_align_raster: Reprojects/resamples and aligns a raster

View source: R/reproject_align_raster.R

reproject_align_rasterR Documentation

Reprojects/resamples and aligns a raster

Description

Reprojects/resamples and aligns a raster by matching a raster a raster to a specified origin, resolution, and coordinate reference system, or that of a reference raster. Useful for preparing adjacent areas before using raster::merge or raster::mosaic. Also, see documentation for mytools::combine_rasters.

Usage

reproject_align_raster(
  rast,
  ref_rast = NULL,
  desired_origin,
  desired_res,
  desired_crs,
  method = "bilinear"
)

Arguments

rast

raster to be reprojected or resampled

ref_rast

reference raster with desired properties (Alternatively can supply desired_origin, desired_res, and desired_crs)

desired_origin

desired origin of output raster as a vector with length 2 (x,y)

desired_res

desired resolution of output raster. Either an integer or a vector of length 2 (x,y)

desired_crs

desired coordinate reference system of output raster (CRS class)

method

resampling method. Either "bilinear" for bilinear interpolation (the default), or "ngb" for using the nearest neighbor


ailich/mytools documentation built on Jan. 7, 2023, 11:16 a.m.