Description Usage Arguments Value See Also Examples
The function reads a collection of geotiffs from a folder and creates a single raster.stack object. It is used to streamline the input of many layers at once since Rgdal does not, at the time of this writing (15.Feb.2016) allow the direct processing of raster gdb files. Each layer should be in it's own geoTiff, although multiple bands within a geoTiff are allowed. Each file should be named with the layer name (see parameters). Optional labels can be supplied, but if no, need to be supplied for all layers.
1 |
rasterPath |
path to the raster file |
layers |
a character list of layer names to read. The filename used will be '<layer[i]>.tif' |
labels |
(optional) a list of names for the columns of the final raster; will use layer names if this is not specified. |
NAval |
(optional) the value to be interpreted as NA; passed to raster::NAvalue |
a raster.stack of the objects in the folder
See the sample data egTile
for an example, and the associated help for examples on how to generate derived data.
1 2 3 4 5 6 | # Read egTile from the provided geoTiff's; gisPath must point to package installation folder.
path <- file.path(system.file("extdata", "egTile", package = "NPEL.Classification"),'')
egTile <- readTile(path, layers=c('base','grnns','wetns','brtns','dem','slp','asp','hsd'))
# Set the aspect layer to NA wherever slope is 0
egTile$asp <- calc (egTile$asp,fun=function(x){ x[x == -1] <- NA; x })
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.