Returns a sf object that includes x- and y- index by using two inputs ncutsx and ncutsy, which are x- and y-directional splits, respectively.
Arguments
- points_in
sf
orSpatVector
object. Target points of computation. character(1) of file path is also acceptable.- ncutsx
integer(1). The number of splits along x-axis.
- ncutsy
integer(1). The number of splits along y-axis.
Note
Grids are generated based on the extent of points_in
first,
then exhaustive grids will be filtered by the intersection between
these and points_in
. Thus, the number of generated grids may be
smaller than ncutsx * ncutsy
.
See also
Other Parallelization:
par_cut_coords()
,
par_fallback()
,
par_grid()
,
par_group_grid()
,
par_hierarchy()
,
par_make_gridset()
,
par_merge_grid()
,
par_multirasters()
Examples
library(sf)
library(terra)
options(sf_use_s2 = FALSE)
nc_path <- system.file("gpkg/nc.gpkg", package = "sf")
nc <- terra::vect(nc_path)
nc_rp <- terra::spatSample(nc, 1000)
nc_gr <- par_make_grid(nc_rp, 10L, 6L)
plot(nc_rp)
plot(nc_gr, add = TRUE)