Learn R Programming

plotKML (version 0.8-3)

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".

See Also

vect2rast

Examples

Run this code
# 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)
# }

Run the code above in your browser using DataLab