match_rasters: Match the coordinate system and extent of two rasters

Description Usage Arguments Details Value Examples

View source: R/match_rasters.R

Description

Match the coordinate system and extent of two rasters

Usage

1
match_rasters(baseimg, matchimg, filename, method = "bilinear", ...)

Arguments

baseimg

A /codeRaster* to use as the base image. This layer will determine the output coordinate system.

matchimg

A /codeRaster* to match to the base image. If necessary the /codematchimg will be reprojected to match the coordinate system of the /codebaseimg. The /codematchimg will then be cropped and extended to match the extent of the /codebaseimg.

filename

file on disk to save Raster* to (optional)

method

the method to use if projection is needed to match image coordinate systems, or if resampling is needed to align image origins. Can be "ngb" for nearest-neighbor, or "binlinear" for bilinear interpolation

...

additional arguments to pass to writeRaster (such as datatype and filename)

Details

Note that match_rasters can run in parallel if beginCluster() is run prior to running match_rasters.

Value

The /codematchimg reprojected (if necessary), cropped, and extended to match the /codebaseimg.

Examples

1
2
3
4
5
# Mosaic the two ASTER DEM tiles needed to a Landsat image
DEM_mosaic <- mosaic(ASTER_V002_EAST, ASTER_V002_WEST, fun='mean')

# Crop and extend the DEM mosaic to match the Landsat image
matched_DEM <- match_rasters(L5TSR_1986, DEM_mosaic)

azvoleff/teamlucc documentation built on June 4, 2017, 12:08 a.m.