rsMove (version 0.2.1)

moveSeg: moveSeg

Description

Remote sensing based point segmentation

Usage

moveSeg(xy = xy, edata = edata, type = "cont", ot = NULL,
  b.size = NULL, threshold = NULL, s.fun = NULL)

Arguments

xy

Object of class SpatialPoints or SpatialPointsDataFrame.

edata

Object of class RasterLayer or data.frame.

type

Raster data type. One of cont (continues) or cat (for categorical).

ot

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

b.size

Buffer size expressed in the map units.

threshold

Change threshold.

s.fun

Output summary function. Default is mean.

Value

A list.

Details

Segmentation of a point shapefile based on the spatial variability of a raster dataset. When the method is set to 'cont', the raster data is assumed to be continuous. Then, the function determines the percentual change between each pair of two consecutive coordinate pairs. If this change is above a predifined threshold, a new pointer is added and the previous sequence of samples is labeled as a unique segment. If method is set as 'cat', the function assumes the raster data is categorical ignoring the theshold and s.fun keywords. In this case, a new segment is identified if the any change is observed between two consecutife points. The output consists of a list containing a SpatialPointsDataFrame ($points) reporting on the segment ID (sid) associated to each sample and a data frame ($report) with the amount of points in each region and the value returned by s.fun. If ot is provided, the function also provides the elapsed time within each segment. If fun is set by the user, the provided function will be used to summarize the raster values at each segment. Also, if edata is a RasterStack or a RasterBrick, r.fun is used to reduce the multi-layered object to a single layer. he user can either use a Principal Component Analysis (PCA) analysis by setting r.fun to pca or provide a function. If pca is selected, the first Principal Conponent (PC) threshold will be set automatically to the standard deviation of the first PC. This is the default. If method is cat the function will assume the data is categorical and wil define segments whenever a change occurres.

See Also

dataQuery imgInt

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")

 # perform directional sampling
 seg <- moveSeg(xy=moveData, ot=o.time, edata=r, type="cont", threshold=0.1)

}
# }

Run the code above in your browser using DataLab