ursa_new: Create raster image in memory

Description Usage Arguments Details Value Author(s) See Also Examples

Description

ursa_new creates object of class ursaRaster in memory using session grid parameters or properties of input object (matrix or array). By option, band names and ignore values are specified.

Usage

1

Arguments

...

Set of arguments, which are recognized via their names (using regular expressions) and classes:

value

Pattern is "(|^value)". Admissible classes are (matrix, array,numeric,logical. Values to fill image. Array or matrix defines raster grid. If value=FALSE (logical), then created raster image has no values. By default, value=NA, the created raster image is filled by blank values (NA).

nband

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

bandname

Character. Band names. Default is NULL. If specified, then nband is ignored, and the number of bands is equal to length of bandname character vector.

ignorevalue

Integer or numeric. Value in ENVI binary file, which is interpretted as NA in R.

datatype

Positive integer c(1L, 2L, 3L, 4L, 5L, 11L, 12L, 13L) or character. Data type (integer, floating-point) and byte length. See details for argument datatype of function create_envi. Required for writing raster to ENVI binart file. Optional for rasters in memory. Default is NA: data type is defined internally.

colortable

Object of class ursaColorTable. Color table for raster. Default is NULL: color table is absent

permute

Logical. Should dimensions of input matrix be changed. Default is FALSE.

flip

Logical. Vertical flip for input matrix. Default is FALSE: no flip.

crs

Character or object of class ursaGrid. The reference grid for raster's cells. Default is NULL: the grid is defined ether from matrix/array structure or from sessional parameters.

verb(ose)*

Logical. Value TRUE may provide some additional information on console. Default is FALSE.

Details

ursa_new creates ursaRaster object in memory. To manipulate with raster chunks use the followed construction:

1
2
3
4
5
a <- create_envi(fname,...)
a[condition_1] <- value
print(a[condition_2]
...
close(a)

ursa_new is designed to create blank raster images. Use as.ursa for conversion R objects to ursaRaster.

Value

Object of class ursaRaster.

Author(s)

Nikita Platonov platonov@sevin.ru

See Also

as.ursa, create_envi.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
session_grid(NULL)
a1 <- ursa_new(volcano)
print(a1)
display(a1)

a2 <- ursa_new(volcano,flip=TRUE)
print(a2)
display(a2)

a3 <- ursa_new(volcano,permute=TRUE)
print(a3)
display(a3)

dima <- c(200,300,4)
b1 <- as.ursa(array(runif(prod(dima)),dim=dima))
print(b1)
display_brick(b1,scale=1,palname="Greys",decor=FALSE)

session_grid(NULL)

c1 <- ursa_new(seq(3))
print(c1)
c2 <- ursa_new(seq(3),bands=3)
print(c2)

c3 <- ursa_new(value=FALSE)
str(ursa_value(c3))

c4 <- ursa_new(bands=2,nodata=-99L)
print(c4)
print(ignorevalue(c4))

c5 <- ursa_new(bandname=format(Sys.Date()+seq(7)-1,"%A"))
ursa_value(c5) <- rev(seq(nband(c5)))
c5 <- colorize(c5)
ct <- ursa_colortable(c5)
print(c5)

v <- ursa_value(c5[3:5])
str(v)
v <- c(v)
str(v)
c6 <- ursa_new(v,colortable=ct)
print(c6)
print(ursa_colortable(c6))

ursa documentation built on May 23, 2021, 1:06 a.m.