Makes a grid adapted to the purpose of this package and simplifying options
from the sf
package. The central concept of the BIRDS package is the
definition of the field visit, and most likely, your grid size will define the
maximum area a person can explore during a day. Use the function
exploreVisits()
to assess if your definition of visit aligns with your
grid size.
makeGrid( poly, gridSize, hexGrid = TRUE, offset = NULL, buffer = FALSE, simplify = FALSE, tol = 0.01 )
poly | an object of class ‘sf’, ‘SpatialPolygon’ or ‘SpatialPolygonDataFrame’ |
---|---|
gridSize | width of the cells in Km. It defines the central assumption of this package that is the maximum area a person can explore during a day. Be aware, that the spatial extent of a visit is dependent on the taxonomic group, and many other variables. Maximum recommended for this package 10 km if there is no reliable definition for the spatial extent for visits. |
hexGrid | shall the grid cells be hexagonal? Then |
offset | numeric of length 2 with lower left corner coordinates (x, y)
of the grid. If it is left empty ( |
buffer | shall the grid cells include the polygon border? Then |
simplify | simplifies the polygon geometry. Complicated polygons (those with much detail) make this function run slower. |
tol | numerical tolerance value for the simplification algorithm. Set to 0.01 as default. |
an object of class ‘sf’ with a set of polygons conforming to a grid of equal-area cells, with geodesic coordinates in WGS84 (ESPG:4326).
Depending on the total number of grid cells the computations may take time. If there are more than 500 cells on any dimension a warning message will be displayed. Grid cells must be smaller than the sampling area. If the grid cell size is wider than the polygon on any dimension an error message will be displayed.
# \donttest{ grid <- makeGrid(gotaland, gridSize = 10) # }