Transfer vector data to a raster
# S4 method for SpatVector,SpatRaster
rasterize(x, y, field=1:nrow(x), background=NA, update=FALSE,
touches=is.lines(x), filename="", overwrite=FALSE, wopt=list(), ...)
SpatVector
SpatRaster
numeric. The values to be rasterized. Either a field name of x
, a single number, or a vector with the same length as x
numeric. Value to put in the cells that are not covered by any of the features of x
. Default is NA
logical. If TRUE
, all cells touched by lines or polygons will be updated, not just those on the line render path, or whose center point is within the polygon
logical. If TRUE
, the values of the Raster* object are updated for the cells that overlap with the geometries of x
. Default is FALSE
character. Output filename. Optional
logical. If TRUE
, filename
is overwritten
list. Options for writing files as in writeRaster
additional arguments. None implemented
SpatRaster