
Last chance! 50% off unlimited learning
Sale ends in
Class for spatial attributes that have spatial locations on a (full) regular grid on file, not (yet) actually read.
# S3 method for SpatialGDAL
open(con, …, silent = FALSE, allowedDrivers = NULL, options=NULL)
# S3 method for SpatialGDAL
close(con, …)
copy.SpatialGDAL(dataset, fname, driver = getDriver(dataset@grod),
strict = FALSE, options = NULL, silent = FALSE)
file name of grid map for opening, SpatialGDAL object for closing
other arguments (currently ignored)
logical; if TRUE, comment and non-fatal CPL driver errors suppressed
object of class SpatialGDAL
file name of grid map
GDAL driver name
TRUE if the copy must be strictly equivalent, or more normally FALSE indicating that the copy may adapt as needed for the output format
a character vector of suggested driver short names may be provided starting from GDAL 2.0
driver-specific options to be passed to the GDAL driver; only available for opening datasets from GDAL 2.0
Objects can be created by calls of the form open.
SpatialGDAL(name),
, where name
is the name of
the GDAL file.
points
:see SpatialPoints; points slot which is not actually filled with all coordinates (only with min/max)
grid
:see GridTopology-class; grid parameters
grid.index
:see SpatialPixels-class; this slot is of zero length for this class, as the grid is full
bbox
:Object of class "matrix"
; bounding box
proj4string
:Object of class "CRS"
; projection
data
:Object of class data.frame, containing attribute data
Class Spatial-class, directly.
signature(x = "SpatialGDAL", i, j, ...)
:
selects rows (i), columns (j), and bands (third argument); returns an object of
class SpatialGridDataFrame-class. Only the selection is actually read.
signature(i)
: reads band i and returns the values as a
numeric vector
SpatialGridDataFrame-class
, which is actually sub-classed.
# NOT RUN {
x <- open.SpatialGDAL(system.file("external/test.ag", package="sp")[1])
image(x[])
image(as(x, "SpatialGridDataFrame"))
summary(as(x, "SpatialGridDataFrame"))
spplot(as(x, "SpatialGridDataFrame"))
# select first 50 rows:
summary(x[1:50])
# select first 50 columns:
summary(x[,1:50])
# select band 1:
summary(x[,,1])
# select first 50 rows, first 50 columns, band 1:
summary(x[1:50,1:50,1])
# get values of first band:
summary(x[[1]])
close(x)
# }
Run the code above in your browser using DataLab