Learn R Programming

rsMove (version 0.1)

moveSeg: moveSeg

Description

Remote sensing based point segmentation

Usage

moveSeg(xy = xy, img = img, type = "cont", threshold = 0.1,
  fun = NULL)

Arguments

xy

Object of class SpatialPoints or SpatialPointsDataFrame.

img

Object of class RasterLayer, RasterStack or RasterBrick.

type

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

threshold

Percent change threshold.

fun

Summary function.

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 keyword. 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 fun. If fun is set by the user, the provided function will be used to summarize the raster values at each segment. Also, if img is a RasterStack or a RasterBrick, the fun is used to reduce the multi-layered object to a single layer. By default, the maximum value is used. Like for threshold, fun is ignored if method is cat.

See Also

timeDirSample dataQuery

Examples

Run this code
# NOT RUN {
{
 
 require(rgdal)
 require(raster)
 require(sp)
 
 # read movement data
 moveData <- shapefile(system.file('extdata', 'konstanz_20130804.shp', package="rsMove"))
 
 # read raster data
 r <- raster(system.file('extdata', 'tcb_1.tif', package="rsMove"))
 
 # perform directional sampling
 seg <- moveSeg(xy=moveData, img=r, type="cont", threshold=0.1)
 
}
# }

Run the code above in your browser using DataLab