createAggregationGrid: Create a regular aggregation grid

View source: R/createAggregationGrid.R

createAggregationGridR Documentation

Create a regular aggregation grid

Description

createAggregationGrid Creates a regular stars grid, which can be used for aggregating an sf polygon sfc.

Usage

createAggregationGrid(
  object = asgerbachelor::ecoregions_L0,
  delta = 50000,
  crs = st_crs(2163)
)

Arguments

object

a sf object with a bounding box which can be obtained via sf::st_bbox.

delta

numeric. Width of cells in the grid (in the units of the supplied crs).

crs

an object of class crs. Desired coordinate reference system (CRS) of the output grid.

Details

The created grid is centered on (0,0)

Value

An object of class stars with 2 dimensions and 1 attribute, ID, which is unique for each grid cell.

Warnings

It is important that the supplied CRS is uses a equal area projection, to avoid spatial biases in the size of the aggregation cells.


asgersvenning/bachelor documentation built on May 2, 2023, 7:06 a.m.