Learn R Programming

dtwSat (version 0.2.8)

twdtwRaster-class: class "twdtwRaster"

Description

Class for set of satellite time series.

Usage

# S4 method for ANY
twdtwRaster(
  ...,
  timeline,
  doy = NULL,
  layers = NULL,
  labels = NULL,
  levels = NULL,
  filepath = NULL
)

# S4 method for twdtwRaster dim(x)

# S4 method for twdtwRaster res(x)

# S4 method for twdtwRaster extent(x, y, ...)

# S4 method for twdtwRaster,ANY writeRaster(x, filepath = ".", ...)

# S4 method for twdtwRaster ncol(x)

# S4 method for twdtwRaster nrow(x)

# S4 method for twdtwRaster nlayers(x)

# S4 method for twdtwRaster levels(x)

# S4 method for twdtwRaster layers(x)

# S4 method for twdtwRaster coverages(x)

# S4 method for twdtwRaster bands(x)

# S4 method for twdtwRaster names(x)

# S4 method for twdtwRaster index(x)

# S4 method for twdtwRaster length(x)

# S4 method for twdtwRaster,ANY,ANY,ANY [(x, i)

# S4 method for twdtwRaster,ANY,ANY [[(x, i)

# S4 method for twdtwRaster labels(object)

# S4 method for twdtwRaster crop(x, y, ...)

# S4 method for twdtwRaster coordinates(obj, ...)

# S4 method for twdtwRaster extent(x, y, ...)

# S4 method for twdtwRaster show(object)

# S4 method for ANY is.twdtwRaster(x)

# S4 method for twdtwRaster projecttwdtwRaster(x, crs, ...)

Arguments

...

objects of class RasterBrick-class or RasterStack-class.

timeline

a vector with the dates of the satellite images in the format of "YYYY-MM-DD".

doy

A RasterBrick-class or RasterStack-class with a sequence of days of the year for each pixel. doy must have the same spatial and temporal extents as the Raster* objects passed to .... If doy is not provided then at least one Raster* object must be passed through ....

layers

a vector with the names of the Raster* objects passed to "...". If not provided the layers are set to the names of objects in "...".

labels

a vector of class character with labels of the values in the Raster* objects. This is useful for categorical Raster* values of land use classes.

levels

a vector of class numeric with levels of the values in the Raster* objects. This is useful for categorical Raster* values of land use classes.

filepath

A character. The path to save the raster time series. If provided the function saves a raster file for each Raster* object in the list, i.e one file for each time series. This way the function retrieves a list of RasterBrick-class. It is useful when the time series are originally stored in separated files. See details.

x

an object of class twdtwRaster.

y

Extent object, or any object from which an Extent object can be extracted.

i

indices of the time series.

object

an object of class twdtwRaster.

obj

object of class twdtwRaster.

crs

character or object of class 'CRS'. PROJ.4 description of the coordinate reference system. For other arguments and more details see projectRaster.

Methods (by generic)

  • twdtwRaster(ANY): Create object of class twdtwRaster.

  • is.twdtwRaster(ANY): Check if the object belongs to the class twdtwRaster.

  • projecttwdtwRaster(twdtwRaster): project twdtwRaster object.

Slots

timeseries:

A list of multi-layer Raster* objects with the satellite image time series.

timeline:

A vector of class date with dates of the satellite images in timeseries.

layers:

A vector of class character with the names of the Raster* objects.

labels:

A vector of class factor with levels and labels of the values in the Raster* objects. This is useful for categorical Raster* values of land use classes.

Author

Victor Maus, vwmaus1@gmail.com

Details

The performance of the functions twdtwApply and getTimeSeries is improved if the Raster* objects are connected to files with the whole time series for each attribute.

References

Maus:2019dtwSat

Maus:2016dtwSat

See Also

twdtwApply, getTimeSeries, twdtwMatches-class, and twdtwTimeSeries-class

Examples

Run this code
# Creating a new object of class twdtwTimeSeries 
evi = brick(system.file("lucc_MT/data/evi.tif", package="dtwSat"))
timeline = scan(system.file("lucc_MT/data/timeline", package="dtwSat"), what="date")
rts = new("twdtwRaster", timeseries = evi, timeline = timeline)

if (FALSE) {
# Creating objects of class twdtwRaster 
evi = brick(system.file("lucc_MT/data/evi.tif", package="dtwSat"))
timeline = scan(system.file("lucc_MT/data/timeline", package="dtwSat"), what="date")
ts_evi = twdtwRaster(evi, timeline=timeline)

ndvi = brick(system.file("lucc_MT/data/ndvi.tif", package="dtwSat"))
blue = brick(system.file("lucc_MT/data/blue.tif", package="dtwSat"))
red = brick(system.file("lucc_MT/data/red.tif", package="dtwSat"))
nir = brick(system.file("lucc_MT/data/nir.tif", package="dtwSat"))
mir = brick(system.file("lucc_MT/data/mir.tif", package="dtwSat"))
doy = brick(system.file("lucc_MT/data/doy.tif", package="dtwSat"))
rts = twdtwRaster(doy, evi, ndvi, blue, red, nir, mir, timeline = timeline)
}

Run the code above in your browser using DataLab