Description Usage Arguments Details Value See Also Examples
Pixel-based labeling of spatially connected groups of points in a SpatialPoints object.
1 | labelSample(x, y, nr.points = 1, nr.pixels = NULL, agg.radius = NULL)
|
x |
Object of class SpatialPoints of SpatialPointsDataFrame. |
y |
Pixel resolution or a valid raster layer. |
nr.points |
Minimum number of observations per pixel. |
nr.pixels |
Minimum number of pixels per region. |
agg.radius |
Minimum radius for pixel aggregation. Unit depends on the projection of the data. |
First, the observations are converted to pixel coordinates and pixels with a corresponding number of observations greater than nr.points are filtered out. Then, if nr.pixels is set, the function evaluates the spatial connectivity of the pixels and regions with a pixel count smaller than nr.pixels are filtered out. Then, the algorithm aggregates nearby regions within the distance specified by agg.radius. The final region identifiers are then assigned back to the original observations in x based on their corresponding pixel coordinates. This analysis is based on the spatial extent of x and a given pixel resolution (y). Alternatively, the user may assign a raster object as y assuring that the final output is aligned with it.
A numeric vector with region identifiers for each observation in x to their correspondent pixel region. Filtered observations are returned as NA.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | {
require(raster)
# read raster data
r <- raster(system.file('extdata', '2013-07-16_ndvi.tif', package="rsMove"))
# read movement data
data(shortMove)
# derive region labels
labels <- labelSample(shortMove, r, agg.radius=60)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.