Learn R Programming

rsMove (version 0.1)

imgInt: imgInt

Description

Temporal linear interpolation of raster data.

Usage

imgInt(img = img, rd = rd, td = td, bs = NULL, xy = NULL)

Arguments

img

Object of class RasterStack or RasterBrick.

rd

Raster dates. Object of class Date.

td

Target dates. Object of class Date.

bs

Temporal buffer size (in days).

xy

Object of class SpatialPoints or SpatialPointsDataFrame.

Value

A RasterBrick or a data frame.

Details

Performs a pixel-wise linear interpolation over a raster for a given set of dates (td). A teporal buffer (bs) is required to limit the search for reference data points (rd). If xy is provided the function only considers the pixels that overlap with the these sample points. Otherwise, a RasterBrick is provided.

See Also

@seealso dataQuery timeDirSample spaceDirSample

Examples

Run this code
# NOT RUN {
{
 
 require(rgdal)
 require(raster)
 require(sp)
 
 # read movement data
 file <- system.file('extdata', 'konstanz_20130805-20130811.shp', package="rsMove")
 moveData <- shapefile(file)
 
 # read raster data
 file <- list.files(system.file('extdata', '', package="rsMove"), 'tc.*tif', full.names=TRUE)
 rsStk <- stack(file)
 rsStk <- stack(rsStk, rsStk, rsStk) # dummy files for the example
 
 # raster dates
 rd = seq.Date(as.Date("2012-01-01"), as.Date("2012-12-31"), 45)
 
 # target dates
 td = seq.Date(as.Date("2012-04-01"), as.Date("2012-08-31"), 45)
 
 # interpolate raster data to target dates
 i.img <- imgInt(img=rsStk, rd=rd, td=td, bs=60, xy=moveData)
 
}
# }

Run the code above in your browser using DataLab