R/fwTranslate.R

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 rasterFW package in your browser

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

rasterFW documentation built on May 2, 2019, 5:19 p.m.