Learn R Programming

spacetime (version 1.3-2)

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

Value

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

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

Author

Edzer Pebesma; time-enabled grass by Soeren Gebbert

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

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

Examples

Run this code
if (FALSE) {
library(spacetime)
r = read.tgrass("precipitation_1950_2011_yearly.tar.gz", useTempDir = FALSE)
write.tgrass(r, "myfile.tar.gz")
}

Run the code above in your browser using DataLab