extractRaster: Extract Raster into Polygons

View source: R/fun_extract.R

extractRasterR Documentation

Extract Raster into Polygons

Description

This function extracts the information contained in raster tiles into the basemap. It operates a one-to-one matching using the tiles names. If unnamed, the workflow is slower and could leave out a small number of polygons.

Usage

extractRaster(sf, rast, fun, tile = NULL, newcol)

Arguments

sf

One sf object, i.e. a basemap tile

rast

A list of raster tiles, ideally named to match mastermap tiles (as obtained through makeTiles())

fun

The function to be applied in zonal stats. Either "mean" for numeric values, or "majority" for the most common occurrence.

tile

The OS tile grid reference to match raster to mastermap tile; can be set dynamically with mapply

newcol

The name of the new attribute with extracted values

Value

An updated mm object with a new column containing the extracted values


ecoservR/ecoserv_tool documentation built on April 5, 2025, 1:49 a.m.