gengrid | R Documentation |
Polygonize a raster and compute zonal statistics at polygon and full shape-file level
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 )
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 |
list object aggregated zonal statistic, polygon data and summary statistics on polygon data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.