ursa_dummy: Generate raster image for examples.

ursa_dummyR Documentation

Generate raster image for examples.

Description

ursa_dummy returns georeferenced raster image with required number of bands. The value of such image has no sence in reality, but are suitable for R's examples.

Usage

ursa_dummy(nband = 3L, minvalue = 0, maxvalue = 255, mul = 1, elements = 8L,
           bandname = NULL, nodata = TRUE, resetGrid=FALSE)

Arguments

nband

Positive integer. Number of bands. Default is 3L.

minvalue

Numeric of length 1. Minimal value for raster image. Default is 0.

maxvalue

Numeric of length 1. Maximal value for raster image. Default is 255.

mul

Positive numeric. The scaling of the existing session grid. Value 1 means the actual pixel size. Value <1 decreases image size by increasing cell size. Value >1 decreases image size by increasing cell size. Default is 1.

elements

Positive integer. Maximal dimension of matrix, which is proportional to session grid. If elements has small value then the resulting image is smooth, like low-resolution image. The elements has big value, then the resulting image is like white noise.

bandname

Character vector or NULL. Band names for created raster image. If NULL, then band names are generated autimatically. Default is NULL.

nodata

Numerical or logical. Set value, which is interpreted as 'no-data' flag. If logical and FALSE then no no-data flag is assigned. If logical and TRUE then value of no-data flag is generated automatically. If numeric, then no-data is assigned to value of this argument. Default is TRUE.

resetGrid

Logical. Whether the grid will be reset to default before raster generation? If FALSE then raster is generated in the sessional grid. If TRUE then default parameters are used for raster and session. Default is FALSE.

Details

Currently, the values are generated using runif.

The value mul<1 speeds up raster generation.

Value

Object of class ursaRaster

Author(s)

Nikita Platonov platonov@sevin.ru

Examples

session_grid(NULL)
a1 <- as.integer(ursa_dummy(nband=1,mul=1/16,elements=1e3))  ## white noise
 ## to avoid over-time during example check -- begin
   display(a1,legend=NULL)
 ## to avoid over-time during example check -- end
a2 <- ursa_dummy()
print(a2)
display_brick(a2,decor=FALSE)
display_stack(a2,decor=FALSE)
display_rgb(a2,decor=FALSE)

ursa documentation built on Sept. 30, 2024, 9:35 a.m.