make_2d_grid | R Documentation |
Creates a raster (terra 'SpatRaster'), point grid (sf 'POINT'), or polygon mesh/'fishnet' (sf 'POLYGON') from an sf polygon.
make_2d_grid(
obj,
resolution = c(3704, 3704),
output_type = "point",
bbox = NULL,
model = "semi-open",
include_tile_center = FALSE
)
obj |
An sf polygon. |
resolution |
Resolution for grid cells. Default = c(3704, 3704), equivalent of 2x2 nautical miles. |
output_type |
Type of output as a 1L character vector ("point", "raster", "polygon). |
bbox |
Optional. A 4L numeric vector to define the edges of the interpolation grid c(xmin, ymin, xmax, ymax). |
model |
Character vector indicating the geometry model to use for st_intersection boundaries. Default = "semi-open"; for details see ?s2::s2_options |
include_tile_center |
Should the center point of each tile be included in the output? This helps with plotting data because the center point for grid locations after interecting with the stratum shapefile is not always the center of a grid cell since intersected cells are not always squares. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.