Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vect2rast.SpatialPoints

Converts points to rasters


Description

Converts object of class "SpatialPoints*" to a raster map, and (optional) writes it to an external file (GDAL-supported formats; it used the SAGA GIS format by default).

Usage

vect2rast.SpatialPoints(obj, fname = names(obj)[1], cell.size, bbox, 
      file.name, silent = FALSE, method = c("raster", "SAGA")[1], FIELD = 0, 
      MULTIPLE = 1, LINE_TYPE = 0, GRID_TYPE = 2, ... )

Arguments

obj

"SpatialPoints*" object

fname

target variable name in the "data" slot

cell.size

(optional) grid cell size in the output raster map

bbox

(optional) output bounding box (class "bbox") for cropping the data

file.name

(optional) file name to export the resulting raster map

silent

logical; specifies whether to print any output of processing

method

character; specifies the gridding method

FIELD

character; SAGA GIS argument attribute table field number

MULTIPLE

character; SAGA GIS argument method for multiple values — [0] first, [1] last, [2] minimum, [3] maximum, [4] mean

LINE_TYPE

character; SAGA GIS argument method for rasterization — [0] thin, [1] thick

GRID_TYPE

character; SAGA GIS argument for coding type — [0] integer (1 byte), [1] integer (2 byte), [2] integer (4 byte), [3] floating point (4 byte), [4] floating point (8 byte)

...

additional arguments that can be passed to the raster::rasterize command

Value

Returns an object of type "SpatialGridDataFrame".

Author(s)

Tomislav Hengl

See Also

Examples

## Not run: 
library(sp)
data(meuse)
coordinates(meuse) <- ~x+y
# point map:
x <- vect2rast(meuse, fname = "om")
data(SAGA_pal)
sp.p <- list("sp.points", meuse, pch="+", cex=1.5, col="black")
spplot(x, col.regions=SAGA_pal[[1]], sp.layout=sp.p)

## End(Not run)

plotKML

Visualization of Spatial and Spatio-Temporal Objects in Google Earth

v0.8-1
GPL
Authors
Tomislav Hengl [cre, aut], Andrea Gilardi [ctb], Pierre Roudier [ctb], Dylan Beaudette [ctb], Edzer Pebesma [ctb], Michael Blaschek [ctb]
Initial release
2021-04-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.