gengrid: Polygonize a raster and compute zonal statistics at polygon...

View source: R/gengrid.R

gengridR Documentation

Polygonize a raster and compute zonal statistics at polygon and full shape-file level

Description

Polygonize a raster and compute zonal statistics at polygon and full shape-file level

Usage

gengrid(
  dsn = "data-raw",
  layer = "gadm36_CMR_0",
  stats = "sum",
  featname = "population",
  raster_tif = "cmr_ppp_2020_UNadj_constrained.tif",
  grid_shp = T,
  grid_size = 1,
  crs = "+proj=longlat +datum=WGS84 +no_defs",
  drop_Zero = T
)

Arguments

dsn

stands for data source name (see sf::st_read documentation for more information)

layer

layer name (see sf::st_read documentation for more information), will also accept object of class "sf"

stats

zonal statistics to be estimated

featname

the feature that the zonal statistic is computed for

raster_tif

raster file with tif extension

grid_shp

if TRUE, a grid system will be created for the shapefile (shp), grid_size must be specified

grid_size

the diagonal length of the polygon in km

crs

the co-ordinate reference system to be used

drop_zero

if TRUE, gengrid will keep only zonal statistics that are different from zero

Value

list object aggregated zonal statistic, polygon data and summary statistics on polygon data


SSA-Statistical-Team-Projects/SAEplus documentation built on Aug. 24, 2022, 11:26 a.m.