R/fwTranslate.R

Defines functions fwTranslate

Documented in fwTranslate

fwTranslate <- function(x, filename, format, options=NULL) {

	fwp <- paste(fwPath(), 'gdal_translate', sep='')
	
	x <- .getFilename(x)
	if (trim(filename) == "") {
		filename <- rasterTmpFile()
		extension(filename) <- 'tif'
		format <- 'GTiff'
	} else if (missing(format)) {
		format <- 'GTiff'	
	}
	fullcall <- paste(fwp, options, x, shQuote(filename), "-of", format)
	system(fullcall)
	raster(filename)
}

Try the rasterExt package in your browser

Any scripts or data that you put into this service are public.

rasterExt documentation built on May 2, 2019, 4:49 p.m.