ursa_000: Get and set properties of raster image.

ursaR Documentation

Get and set properties of raster image.

Description

For package description see.

ursa is a wrapper to initialize object of class ursaRaster, to get and to set properties for this object.

Usage

ursa(obj, attr, ...)
ursa(obj, attr, ...) <- value

Arguments

obj

Any numeric structure (scalar, matrix, array) for initializing. Object of class ursaRaster for extracting and assigning properties.

attr

Character. Name of property.

...

Arguments, which are passed for properties specification.

value

Value for property assignment.

Details

Initializing function ursa with missing argument attr is a wrapper for function as.ursa.

Matched pattern Replace method? Description of property Implementation
"grid" Yes Raster grid (extent, projection, cellsize) ursa_grid
"(proj|crs)" Yes Coordinate reference system ursa_proj
"val" Yes Raster value in the internal storage format ursa_value
"(colort|ct)" Yes Color table ursa_colortable
"(categ|class)" Yes Names of categories names(ursa_colortable(obj))
"name" Yes Band names names
"(nodata|ignorevalue|bg)" Yes Value, which is interpreted as NA. ignorevalue
"^table$" No Frequency of unique values as.table
"cell" No Squared cell size with(ursa_grid(obj),sqrt(resx*resy))
"^dim$" No Dimension of raster image dim
"(extent|bbox)" No Spatial extent of raster image with(ursa_grid(obj),c(xmin=minx,ymin=miny,xmax=maxx,ymax=maxy))
"(nrow|rows|lines)" No Number of rows of raster image ursa_grid(obj)$rows
"(ncol|columns|samples)" No Number of columns of raster image ursa_grid(obj)$columns
"con" No structure of connection obj$con
"(info|meta(data)*)" No Metadata, brief info ursa_info
"^file(name)*" No Connection name (filename) obj$con$fname

Argument ... is used to specify band index or band pattern in ursa(obj,"value",...)

Value

Inititalizing function ursa (missing attr) returns object of class ursaRaster.

Extract function ursa returns object of respective property.

Replace function ursa<- returns object

Author(s)

Nikita Platonov platonov@sevin.ru

See Also

as.ursa

Examples

a1 <- ursa(volcano)
print(a1)
 ## to avoid over-timing during tests -- begin
   display(a1)
 ## to avoid over-timing during tests -- end

a2 <- ursa(volcano,flip=TRUE)
print(a2)
 ## to avoid over-timing during tests -- begin
   display(a2)
 ## to avoid over-timing during tests -- end 

a3 <- ursa(volcano,permute=TRUE)
print(a3)
 ## to avoid over-timing during tests -- begin
   display(a3)
 ## to avoid over-timing during tests -- end

a4 <- ursa(volcano,flip=TRUE,permute=TRUE)
print(a4)
 ## to avoid over-timing during tests -- begin
   display(a4)
 ## to avoid over-timing during tests -- end

dima <- c(200,300,4)
b1 <- ursa(array(runif(prod(dima)),dim=dima))
print(b1)
display_brick(b1,scale=1,pal.rotate=0,pal.hue=0,decor=FALSE)
session_grid(NULL)

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

c3 <- ursa(value=FALSE)
str(ursa(c3,"value"))

c4 <- ursa(bands=2,nodata=-99L)
print(c4)
print(ursa(c4,"nodata"))

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

v <- ursa(c5[3:5],"value")
str(v)
v <- c(v)
str(v)
c6 <- ursa(v,colortable=ct)
print(c6)
print(ursa(c6,"colortable"))

nplatonov/ursa documentation built on May 8, 2024, 6:02 p.m.