conn.open_envi: open_envi file

open_enviR Documentation

open_envi file

Description

open_envi creates object of ursaRaster class, reads ENVI header file and prepares connections for ENVI binary file

Usage

open_envi(fname, resetGrid = FALSE, headerOnly = FALSE, decompress = !headerOnly,
          cache = 0L, ...)

Arguments

fname

Filename; full-name or short-name

resetGrid

Logical. If TRUE then existing base grid (from session_grid) will be overwritten. Otherwise the spatial subsetting will be attempted.

headerOnly

Logical. If TRUE then only reading of ENVI header file without creating connection to binary data; there is no necessary to decompress packed binary in this case. Default is FALSE.

decompress

If ENVI binary file is compressed and you have not to use ENVI values then put decompress=FALSE to avoid useless operation

cache

Integer. Using cache for compressed files. If 0L then cache is not used. If 1L, then cache is used. Any value, which is differed from 0L and 1L, resets cache. Default is 0L.

...

If input file does not exists then these additional arguments will be passed to create_envi function.

Details

open_envi try to find ENVI files (binary and header) and open them. If unsuccessful then function passes ...-arguments to create_envi function

Value

Returns object of class ursaRaster. Values from ENVI binary are not in memory yet.

Author(s)

Nikita Platonov platonov@sevin.ru

See Also

close, create_envi

Examples

session_grid(NULL)
a <- pixelsize()
write_envi(a,"example")
a <- open_envi("example")
dir(pattern="^example.*")
ursa_info(a)
close(a)
rm(a)
envi_remove("example")

## additional arguments are enough to create new ENVI file
dir(pattern="^example.*")
a <- open_envi("example",layername=paste0("test",1:3))
ursa_info(a)
dir(pattern="^example.*")
close(a)
envi_remove("example")

nplatonov/ursa documentation built on May 8, 2024, 6:02 p.m.