rsMove (version 0.2.1)

poly2sample: poly2sample

Description

Convert spatial polygons into point samples.

Usage

poly2sample(pol = pol, re = NULL, mpc = NULL, pr = NULL)

Arguments

pol

Object of class SpatialPolygons or SpatialPolygonDataFrame.

re

Object of class Extent or a raster object from which an extent can be derived.

mpc

Minimum pixel cover (0-100). Default is 100.

pr

Pixel resolution.

Value

A SpatialPointsDataFrame.

Details

Determines coordinates of pixels within a given extent. If re is missing the target extent corresponds to the extent of the polygon layer. In this case, pr is required. If re is an Extent object or re is missing rp is required. mpc can be used to filter pixels with low purity, i.e. pixels where the percentage of area cover by a polygon is below the defined threshold. The output provides the coordinates (x and y) the pixel percent cover (cover) for each selected pixel.

See Also

dataQuery imgInt

Examples

Run this code
# NOT RUN {
{

 require(raster)

 # load example probability image
 file <- system.file('extdata', 'konstanz_probabilities.tif', package="rsMove")
 img <- raster(file)

 # load area of interest
 file <- system.file('extdata', 'konstanz_roi.shp', package="rsMove")
 roi <- shapefile(file)

 # segment probabilities
 samples <- poly2sample(pol=roi, re=img)

}
# }

Run the code above in your browser using DataLab