raster (version 1.0.4)

getValuesBlock: Get raster cell values

Description

getValuesBlock returns values for a block (rectangular area) of values of a Raster* object. It will take them from memory if available, else it will read them from disk.

Usage

getValuesBlock(x, row, ...)
getValuesExtent(x, e, ...)

Arguments

x
Raster* object
row
Numeric. Row number, should be between 1 and nrow(x), or missing in which case all values are returned
...
Additional arguments for getValuesBlock, see Details
e
extent object

Value

  • vector with raster values

Details

Additional arguments for readValuesBlock: rll{ nrows Integer. How many rows? Default is 1 col Integer. Start column. Default is 1 ncols Integer. How many columns? Default is the number of colums left after the start column } There are no additional arguments for readValuesExtent

Examples

Run this code
r <- raster(system.file("external/test.grd", package="raster"))
b <- getValuesBlock(r, row=100, nrows=3, col=10, ncols=5)
b
dim(b) = c(3,5)
b
e = extent(180078, 180251, 330247, 330433)
getValuesExtent(r, e)

Run the code above in your browser using DataLab