CreateGrid: Create a Regularly Spaced SpatialPointsDataFrame

Description Usage Arguments Value See Also Examples

View source: R/gridandmat.R

Description

This function creates a regular grid of SpatialPointsDataFrame from the extent of a given sp object and a given resolution.

Usage

1
CreateGrid(w, resolution)

Arguments

w

sp object; the spatial extent of this object is used to create the regular SpatialPointsDataFrame.

resolution

numeric; resolution of the grid (in map units). If resolution is not set, the grid will contain around 7500 points. (optional)

Value

The output of the function is a SpatialPointsDataFrame of regularly spaced points with the same extent as w.

See Also

CreateDistMatrix

Examples

1
2
3
4
5
6
# Create a SpatialPointsDataFrame grid of spatMask extent and 200 meters 
# resolution
data(spatData)
mygrid <- CreateGrid(w = spatMask, resolution = 200)
plot(mygrid, cex = 0.1, pch = ".")
plot(spatMask, border="red", lwd = 2, add = TRUE)

SpatialPosition documentation built on Sept. 6, 2017, 5:04 p.m.