50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

inlmisc (version 0.3.2)

ExportRasterStack: Export Raster Stack

Description

This function writes a raster-stack, a collection of raster layers, to local directories using multiple file formats.

Usage

ExportRasterStack(rs, path, zip = "", col = grDevices::rainbow(250, start =
  0, end = 0.8))

Arguments

rs

'RasterStack'. A collection of '>RasterLayer objects with the same extent and resolution.

path

'character'. Path name to write raster stack.

zip

'character'. If there is no zip program on your path (on windows), you can supply the full path to a zip.exe here, in order to make a KMZ file.

col

'character'. Vector of colors

Value

Used for the side-effect files written to disk.

Details

Five local directories are created under path and named after their intended file formats: Comma-Separated Values (csv), Portable Network Graphics (png), Georeferenced TIFF (tif), R Data (rda), and Keyhole Markup Language (kml). For its reference system, kml uses geographic coordinates: longitude and latitude components as defined by the World Geodetic System of 1984. Therefore, the conversion of gridded data between cartographic projections may introduce a new source of error.

To install zip.exe on windows, download the latest binary version from the Info-ZIP website; select one of the given FTP locations, enter directory win32, download zip300xn.zip, and extract.

See Also

writeRaster

Examples

Run this code
# NOT RUN {
  f <- "SIR2016-5080/ancillary/uncalibrated/data/rda/rasters.rda"
  load(file = f)
  ExportRasterStack(rs, tempdir())
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab