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
)

Arguments

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 TRUE (default). Else squared grid cells.

offset

numeric of length 2 with lower left corner coordinates (x, y) of the grid. If it is left empty (NULL, default), then takes default values st_bbox(x)[c("xmin", "ymin")].

buffer

shall the grid cells include the polygon border? Then TRUE (default = FALSE).

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.

Value

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).

Note

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.

See also

Examples

# \donttest{ grid <- makeGrid(gotaland, gridSize = 10) # }