arc.raster: Load or create "arc.raster" object

arc.rasterR Documentation

Load or create "arc.raster" object

Description

Methods to create a arc.raster object from scratch, extent, arc.open object or a raster file (inside or outside of a file geodatabase).

Usage


## 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, ...)

Arguments

object

codearc.datasetraster-class object.

bands

optional, integer. List of bands to read (default: all bands).

...

optional additional arguments such as nrow, ncol, extent, pixel_type, resample_type to be passed to the method. Use overwite=TRUE to overwite existing dataset.

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 object@nrow.

ncol

optional, integer > 0. Number of columns for the raster or mosaic dataset. The default is object@ncol.

nband

integer > 0. Number of bands to create.

extent

optional, list. extent of raster to be read. The default is object@extent.

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 pixel_type. See also ArcGIS Help: Pixel Types. The default is object@pixel_type.

nodata

numeric, value for no data values.

sr

optional transform raster to spatial reference. The default is object@sr.

Value

arc.raster returns a raster object (type of arc.raster-class.).

References

  1. ArcGIS Help: Raster Introduction

  2. ArcGIS Help: Pixel Types

  3. ArcGIS Help: Mosaic Introductions

  4. ArcGIS Help: Mosaicking Rules

See Also

arc.open, arc.write, arc.raster-class

Examples

## 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)

R-ArcGIS/r-bridge documentation built on May 3, 2024, 9:47 a.m.