Learn R Programming

RStoolbox (version 0.1.1)

rasterCVA: Change Vector Analysis

Description

Calculateds angle and magnitude of change vectors. Dimensionality is limited to two bands per image.

Usage

rasterCVA(x, y, ...)

Arguments

x
RasterBrick or RasterStack with two layers. Both rasters (y and y) need to correspond to each other, i.e. same resolution, extent and origin.
y
RasterBrick or RasterStack with two layers. Both rasters (y and y) need to correspond to each other, i.e. same resolution, extent and origin.
...
further arguments passed to writeRaster

Value

  • Returns a RasterBrick with two layers: change vector angle and change vector magnitude

Details

Change Vector Analysis (CVA) is used to identify spectral changes between two identical scenes which were acquired at different times. CVA is limited to two bands per image. For each pixel it calculates the change in the two-dimensional spectral space. For example for a given pixel in image A and B for the red and nir band the change vector is caclulated for the coordinate pairs: (red_A | nir_A) and (red_B | nir_B).

Examples

Run this code
library(raster)
## Create example data
mtlFile  <- system.file("external/landsat/LT52240631988227CUB02_MTL.txt", package="RStoolbox")
lsat  <- stackMeta(mtlFile)
img_a <- lsat[[3:4]]
mult  <- raster(lsat)
mult[]<-rnorm(ncell(mult))
img_b <- img_a * mult + 10

## Do change vector analysis
cva <- rasterCVA(img_a, img_b)
cva
plot(cva)

Run the code above in your browser using DataLab