SpatialGDAL-class {rgdal} | R Documentation |
Class for spatial attributes that have spatial locations on a (full) regular grid on file, not (yet) actually read.
## S3 method for class 'SpatialGDAL': open(con, ..., silent = FALSE) ## S3 method for class 'SpatialGDAL': close(con, ...) copy.SpatialGDAL(dataset, fname, driver = getDriver(dataset@grod), strict = FALSE, options = NULL, silent = FALSE)
con |
file name of grid map for opening, SpatialGDAL object for closing |
... |
other arguments (currently ignored) |
silent |
logical; if TRUE, comment and non-fatal CPL driver errors suppressed |
dataset |
object of class SpatialGDAL |
fname |
file name of grid map |
driver |
GDAL driver name |
strict |
TRUE if the copy must be strictly equivalent, or more normally FALSE indicating that the copy may adapt as needed for the output format |
options |
driver-specific options to be passed to the GDAL driver |
Objects can be created by calls of the form open.
SpatialGDAL(name),
, where name
is the name of
the GDAL file.
points
:grid
:grid.index
:bbox
:"matrix"
; bounding box proj4string
:"CRS"
; projection 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 vectorNon-fatal CPL errors may be displayed for some drivers, currently for the AIG ArcInfo 9.3 binary raster driver using GDAL >= 1.6.2; the data has been read correctly, but the contents of the info directory did not meet the specifications used to reverse engineer the driver used in GDAL (see http://trac.osgeo.org/gdal/ticket/3031)
Edzer J. Pebesma, e.pebesma@geo.uu.nl
SpatialGridDataFrame-class
, which is actually sub-classed.
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)