write_gdal | R Documentation |
write_gdal
writes in-memory object of class ursaRaster
to disk using GDAL from rgdal package.
write_gdal(obj, ...)
ursa_write(obj, fname, ...)
obj |
Object of class |
... |
Arguments, which are passed to For GDAL formats it is creation options For GDAL formats For GDAL formats |
fname |
Character. File name with extension. |
ursa_write
is simplified call of write_gdal
.
write_gdal
implements writing the whole ursaRaster
object to disk. For multiple access to disk (by chunks), use followed Replace construction:
a <- create_gdal(fname) a[condition_1] <- value1 a[condition_2] <- value2 ... close(a)
Integer code of ENVI data type. See values of the “data type” field in description of the ENVI Header Format.
Nikita Platonov platonov@sevin.ru
create_gdal
, Replace method [<-
for ursaRaster
object, close
method for ursaRaster
object.
write_envi
session_grid(NULL)
ftemp <- tempfile(pattern="",fileext="")
fpath <- dirname(ftemp)
fname <- basename(ftemp)
a <- round(ursa_dummy(1,min=0,max=255,nodata=NA))
write_envi(a,file.path(fpath,paste0(fname,"_1",".envi")))
write_gdal(a,file.path(fpath,paste0(fname,"_2")))
write_gdal(a,file.path(fpath,paste0(fname,"_3",".tif")))
write_gdal(a,file.path(fpath,paste0(fname,"_4")),driver="EHdr")
flist <- dir(path=fpath,pattern=fname,full.names=TRUE)
file.remove(flist)
blist <- basename(flist)
res <- NULL
for (i in seq(4))
res <- c(res,paste(grep(paste0("_",i),blist,value=TRUE),collapse=" "))
print(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.