rsMove (version 0.2.1)

moveReduce: moveReduce

Description

Remote sensing based point segmentation.

Usage

moveReduce(xy = xy, ot = ot, img = img)

Arguments

xy

Object of class SpatialPoints or SpatialPointsDataFrame.

ot

Object of class Date, POSIXlt or POSIXct with xy observation dates.

img

Object of class RasterLayer, RasterStack or RasterBrick.

Value

A list.

Details

SReduces a set of input samples (xy) based on their assignment to unique pixels within a reference raster (img). The function looks at consecutive points ordered by time (ot) and aggregates samples if they remain within the same pixel. If the same pixel is revisited on a later time, that observation is kept as a separate occurrence. For each temporal segment, the function returns mean x and y coordinates, the start and end timestamps, the mean timestamp and the elapsed time.

See Also

sampleMove moveSeg

Examples

Run this code
# NOT RUN {
{
 
 require(raster)

 # read raster data
 r <- raster(system.file('extdata', 'tcb_1.tif', package="rsMove"))
 
 # read movement data
 moveData <- read.csv(system.file('extdata', 'konstanz_20130804.csv', package="rsMove"))
 moveData <- SpatialPointsDataFrame(moveData[,1:2], moveData, proj4string=crs(r))
 
 # observation time
 o.time <- strptime(paste0(moveData@data$date, ' ', moveData@data$time), format="%Y/%m/%d %H:%M:%S")
 
 # reduce amount of samples
 move.reduce <- moveReduce(xy=moveData, ot=o.time, img=r)
 
}
# }

Run the code above in your browser using DataLab