Learn R Programming

spacetime (version 1.1-5)

read.tgrass: read or write tgrass (time-enabled grass) files

Description

read or write tgrass (time-enabled grass) files

Usage

read.tgrass(fname, localName = TRUE, useTempDir = TRUE, isGeoTiff = TRUE) write.tgrass(obj, fname, ...)

Arguments

fname
file name to read from, or write to
localName
logical; if TRUE, fname is a local file, else it is a the full path name to the file
useTempDir
logical: use a temporary directory for extraction?
isGeoTiff
logical: are the files in the tar.gz file GeoTIFFs?
obj
object to export, of class STFDF or RasterStack
...
arguments passed on to writeRaster

Value

read.tgrass returns an object of class RasterStack, writegrass returns nothing

Details

The tgrass format is a gzip'ed tar file (.tar.gz) that has geotiff files (with suffix .tif), and three files (list.txt, proj.txt and init.txt) describing the file names and time slices, coordinate reference system, and dimensions

References

http://dx.doi.org/10.1016/j.envsoft.2013.11.001

Examples

Run this code
## Not run: 
# library(spacetime)
# r = read.tgrass("precipitation_1950_2011_yearly.tar.gz", useTempDir = FALSE)
# write.tgrass(r, "myfile.tar.gz")
# ## End(Not run)

Run the code above in your browser using DataLab