ursa (version 3.8.8)

write_envi: Write raster image to ENVI .hdr Labelled Raster file.

Description

write_envi writes in-memory object of class ursaRaster to disk in the ENVI .hdr Labelled Raster file format.

Usage

write_envi(obj, ...)

Arguments

obj

Object of class ursaRaster.

Arguments, which are passed to create_envi. Usually, only file name (character) is required. If missing, then occasional name is assigned.

Value

Integer code of ENVI data type. See values of the “data type” field in description of the ENVI Header Format.

Details

write_envi implements writting the whole ursaRaster object to disk. For multiple access to disk (by chunks), use followed construction:

a <- create_envi(fname)
a[condition_1] <- value1
a[condition_2] <- value2
...
close(a)

See Also

create_envi, Replace method [<- for ursaRaster object, close_envi (close for ursaRaster object).

write_gdal(...,driver="ENVI") uses GDAL (rgdal) for writting ursaRaster object to the ENVI .hdr Labelled Raster file.

Examples

Run this code
# NOT RUN {
session_grid(NULL)
list1a <- envi_list(tempdir())
list1b <- envi_list()
fname <- tempfile()
a <- ursa_dummy()
bandname(a) <- c("first","second","third")
write_envi(a)
write_envi(a,fname)
list2a <- envi_list(tempdir())
list2b <- envi_list()
fname1 <- list2a[!(list2a %in% list1a)]
fname2 <- list2b[!(list2b %in% list1b)]
a2 <- open_envi(fname1)
print(a2)
close(a2)
envi_remove(c(fname1,fname2))
# }

Run the code above in your browser using DataLab