Learn R Programming

ursa (version 3.10.4)

dim: Dimension of multiband raster image

Description

Retrieve the dimension of an object of class ursaRaster. The replacement function is dummy; it doesn't change raster dimension.

Usage

# S3 method for ursaRaster
dim(x)
# S3 method for ursaRaster
dim(x) <- value

Value

The 'Extract' function dim returns named integer vector of length three: 1) number of lines/rows, 2) number of samples/columns, 3) number of bands/channels/layers.

The 'Replacement' function dim<- returns ursaRaster object without changes.

Arguments

x

Object of class ursaRaster

value

Any. Ignored

Author

Nikita Platonov platonov@sevin.ru

Details

Use extract operator [] and combine function c to change third (e.g., temporal) dimension of raster.
Use regrid function to change grid parameters and to resize/resample raster into new grid.

Examples

Run this code
session_grid(NULL)
session_grid(regrid(mul=1/16))
a <- ursa_dummy(nband=3)
ursa_info(a)
print(dim(a))
dim(a) <- c(25,00,34)
print(dim(a))
b <- create_envi("tmp1",bandname=letters[1:5],compress=FALSE)
print(dim(b))
close(b)
envi_remove("tmp1")

Run the code above in your browser using DataLab