ursa (version 3.10.4)

ursa: 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

Value

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

Extract function ursa returns object of respective property.

Replace function ursa<- returns object

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.

Author

Nikita Platonov platonov@sevin.ru

Details

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

Matched patternReplace method?Description of propertyImplementation
"grid"YesRaster grid (extent, projection, cellsize)ursa_grid
"(proj|crs)"YesCoordinate reference systemursa_proj
"val"YesRaster value in the internal storage formatursa_value
"(colort|ct)"YesColor tableursa_colortable
"(categ|class)"YesNames of categoriesnames(ursa_colortable(obj))
"name"YesBand namesnames
"(nodata|ignorevalue|bg)"YesValue, which is interpreted as NA.ignorevalue
"^table$"NoFrequency of unique valuesas.table
"cell"NoSquared cell sizewith(ursa_grid(obj),sqrt(resx*resy))
"^dim$"NoDimension of raster imagedim
"(extent|bbox)"NoSpatial extent of raster imagewith(ursa_grid(obj),c(xmin=minx,ymin=miny,xmax=maxx,ymax=maxy))
"(nrow|rows|lines)"NoNumber of rows of raster imageursa_grid(obj)$rows
"(ncol|columns|samples)"NoNumber of columns of raster imageursa_grid(obj)$columns
"con"Nostructure of connectionobj$con
"(info|meta(data)*)"NoMetadata, brief infoursa_info
"^file(name)*"NoConnection name (filename)obj$con$fname

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

See Also

as.ursa

Examples

Run this code
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"))

Run the code above in your browser using DataLab