spatial_sync_raster: Spatially Sync Rasters

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/spatial_sync_raster.R

Description

Aligns ("syncs") a Raster to a reference Raster.

Usage

1
2
  spatial_sync_raster(unsynced, reference, method = "ngb",
    size_only = FALSE, raster_size, verbose = FALSE)

Arguments

unsynced

A Raster object to be aligned to the reference raster.

reference

A Raster object to be used as the reference for syncing. Syncing will use the reference's projection, resolution, and extent.

method

Method used to compute values for the new RasterLayer. Either 'ngb' (nearest neighbor) or 'bilinear' (bilinear interpolation).

verbose

verbose=TRUE gives feedback on the process (UNSUPPORTED AT PRESENT).

size_only

TODO

raster_size

TODO

Details

Uses bilinear or nearest neighbor resampling to align a raster to the extent and projection of a reference raster and match the resolution of the reference raster.

Value

Returns a RasterLayer, RasterBrick or RasterStack object synced to the reference raster object.

Author(s)

Jonathan A. Greenberg

See Also

temporal_sync_raster

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
require(R.utils) #Can't be loaded after raster
require(climstats)
load(system.file("extdata/elevTahoe.RData",package="climstats"))

ppt=get_climate_data("PRISM-4km-ppt",
		date_range=c("1999/1/1","1999/12/31"), standardize=TRUE,
		enable_download=TRUE, overwrite=TRUE)

pptTahoe99=spatial_sync_raster(ppt,elevTahoe,method="bilinear")
pptTahoe99
ppt99jan<-raster(pptTahoe99,layer=1)
plot(ppt99jan)

## End(Not run)

STARStools documentation built on May 21, 2017, 4:04 a.m.

Search within the STARStools package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.