powered by
Conversion of a SpatRaster, SpatVector or SpatExtent to a SpatVector of lines.
# S4 method for SpatRaster as.lines(x)# S4 method for SpatVector as.lines(x)# S4 method for SpatExtent as.lines(x, crs="")
# S4 method for SpatVector as.lines(x)
# S4 method for SpatExtent as.lines(x, crs="")
SpatVector
SpatRaster, SpatVector or SpatExtent
character. The coordinate reference system (see crs)
crs
as.lines, as.polygons
as.lines
as.polygons
r <- rast(ncols=2, nrows=2) values(r) <- 1:ncell(r) as.lines(r) as.lines(ext(r), crs=crs(r)) if (gdal() >= "3.0.0") { p <- as.polygons(r) as.lines(p) }
Run the code above in your browser using DataLab