arc.raster | R Documentation |
Methods to create a arc.raster
object from scratch, extent, arc.open
object or a raster file (inside or outside of a file geodatabase).
## S4 method for signature 'arc.datasetraster'
arc.raster(object, bands, ...)
## S4 method for signature 'arc.datasetrastermosaic'
arc.raster(object, bands, ...)
## S4 method for signature 'NULL'
arc.raster(object, path, dim, nrow, ncol, nband, extent,
origin_x, origin_y, cellsize_x, cellsize_y, pixel_type, nodata, sr, ...)
object |
codearc.datasetraster-class object. |
bands |
optional, integer. List of bands to read (default: all bands). |
... |
optional additional arguments such as |
path |
file path (character) or layer name (character). |
dim |
optional. List for number of rows and columns of the raster. |
nrow |
optional, integer > 0. Number of rows for the raster or mosaic dataset. The default is |
ncol |
optional, integer > 0. Number of columns for the raster or mosaic dataset. The default is |
nband |
integer > 0. Number of bands to create. |
extent |
optional, list. extent of raster to be read. The default is |
origin_x |
optional. Minimum x coordinate. |
origin_y |
optional. Minimum y coordinate. |
cellsize_x |
optional. Size of pixel in x-axis. |
cellsize_y |
optional. Size of pixel in y-axis. |
pixel_type |
optional. Type of raster pixels. For details about different pixel types see |
nodata |
numeric, value for no data values. |
sr |
optional transform raster to spatial reference. The default is |
arc.raster
returns a raster
object (type of arc.raster-class.).
arc.open
,
arc.write
,
arc.raster-class
## resample raster
r.file <- system.file("pictures", "cea.tif", package="rgdal")
r <- arc.raster(arc.open(r.file), nrow=200, ncol=200, resample_type="CubicConvolution")
stopifnot(r$nrow == 200 && r$resample_type == "CubicConvolution")
## Not run:
> r
type : Raster
pixel_type : U8 (8bit)
nrow : 200
ncol : 200
resample_type : CubicConvolution
cellsize : 154.256892046808, 154.557002731725
nodata : NA
extent : xmin=-28493.17, ymin=4224973, xmax=2358.212, ymax=4255885
WKT : PROJCS["North_American_1927_Cylindrical_Equal_Area",GEOGCS["...
band : Band_1
## End(Not run)
## create an empty raster
r = arc.raster(NULL, path=tempfile("new_raster", fileext=".img"), extent=c(0, 0, 100, 100), nrow=100, ncol=100, nband=5, pixel_type="F32")
stopifnot(all(dim(r) == c(100, 100, 5)))
## Not run:
> dim(r)
nrow ncol nband
100 100 5
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.