Learn R Programming

velox (version 0.2.0)

VeloxRaster_as.RasterLayer: Cast a VeloxRaster band as a RasterLayer object

Description

as.RasterLayer creates a RasterLayer object from a VeloxRaster band.

Arguments

band

Integer indicating the VeloxRaster band to be transformed.

assign_data_type

Boolean indicating whether the dataType attribute of the returned RasterLayer should be set. If TRUE, the dataType attribute is set to the smallest possible data type.

Value

A RasterLayer object.

Examples

Run this code
# NOT RUN {
## Make VeloxRaster
mat <- matrix(1:100, 10, 10)
vx <- velox(mat, extent=c(0,1,0,1), res=c(0.1,0.1), crs="+proj=longlat +datum=WGS84 +no_defs")
## Cast to RasterLayer
library(raster)
rl <- vx$as.RasterLayer(band=1)

# }

Run the code above in your browser using DataLab