getPoints: getPoints

Description Usage Arguments Value See Also

Description

Use random sampling and K-means clustering to generate a set of coordinates and corresponding weights that can be used to carry out spatial integration over an area represented by an sp object. The weights can be purely spatial, or can determined by the values of a raster representing the process of interest - for example population density. The raster should be such that random points can be sampled from it according to cell values using seegSDM::bgSample.

Usage

1
getPoints(shape, raster, n = 10, perpixel = FALSE, prob = FALSE)

Arguments

shape

an sp object containing one or more polygons representing the region for which integration points are required

raster

a RasterLayer object, optionally containing values determining weights for integration

n

the number of integration points required. Rounded up if not an integer.

perpixel

whether n gives the expected number of points per valid (non-NA and non-zero) pixel, or else the total number of points

prob

whether to weight the integration points by the values of raster. Pixels with value 0 will never be sampled from and negative pixels will cause an error. If all cells are 0 or missing, prob will be set to FALSE and a warning issued.

Value

a three-column matrix giving the coordinates and corresponding weights for the spatial integration points over sp. Note that if there are fewer unique points found than n, only the unique points will be returned. If there are no non-missing cells, a dataframe with 0 rows will be returned and a warning issued.

See Also

Other GIS: bufferMask, condSim, getArea, insertRaster, ll2cart, makeVoronoiPolygons, safeMask, sortPolyData


SEEG-Oxford/seegMBG documentation built on May 9, 2019, 11:08 a.m.