powered by
Conversion of a SpatRaster, SpatVector or SpatExtent to a SpatVector of points.
# S4 method for SpatRaster as.points(x, values=TRUE, na.rm=TRUE, na.all=FALSE)# S4 method for SpatVector as.points(x, multi=FALSE, skiplast=TRUE)# S4 method for SpatExtent as.points(x, crs="")
# S4 method for SpatVector as.points(x, multi=FALSE, skiplast=TRUE)
# S4 method for SpatExtent as.points(x, crs="")
SpatVector
SpatRaster, SpatVector or SpatExtent
logical; include cell values as attributes?
logical. If TRUE a multi-point geometry is returned
TRUE
logical. If TRUE the last point of a polygon (which is the same as the first point) is not included
logical. If TRUE cells that are NA are ignored
NA
logical. If TRUE cells are only ignored if na.rm=TRUE and their value is NA for all layers instead of for any layer
na.rm=TRUE
any
character. The coordinate reference system (see crs)
crs
as.lines, as.points
as.lines
as.points
r <- rast(ncols=2, nrows=2) values(r) <- 1:ncell(r) as.points(r) if (gdal() >= "3.0.0") { p <- as.polygons(r) as.points(p) }
Run the code above in your browser using DataLab