as_raster: Convert to in-memory raster

Description Usage Arguments Details Value

View source: R/lazyraster.R

Description

Create an actual raster::raster object by breaking the lazy contract and demanding pixel values at a given resolution.

Usage

1
2
3
4
5
6
7
as_raster(
  x,
  dim = NULL,
  resample = "NearestNeighbour",
  native = FALSE,
  band = 1L
)

Arguments

x

a lazyraster

dim

dimensions, pixel size in rows and columns

resample

resampling method, see vapour::vapour_read_raster

native

return raster at native resolution, default is FALSE

band

set to 1-based band numbers to return (independently of those set with lazyraster())

Details

Control the dimensions and method for resampling with the 'dim' and 'resample' arguments.

If dim is non-integer it is rounded according to what raster does with the dimensions.

When native = TRUE the dim argument is ignored, and no resampling is performed.

Value

a regular raster 'BasicRaster' in-memory object


mdsumner/lazyraster documentation built on Sept. 8, 2021, 9:36 p.m.