Learn R Programming

ursa (version 3.10.4)

open_gdal: Open GDAL file

Description

open_gdal creates object of ursaRaster class, and prepares connections for data reading.

Usage

open_gdal(fname, engine=c("native", "sf", "gdalraster", "vapour"), verbose = FALSE)

ursa_open(fname, verbose = FALSE)

Value

Returns object of class ursaRaster. Values are not in memory.

Arguments

fname

Character. Filename; full-name or short-name.

engine

Character. Functionality of which package is used for reading data. This is experimental list, which future depends on evolution of reviewed packages and their availability for partial reading of multiband rasters.

verbose

Logical. verbose=TRUE provides some additional information on console. Default is FALSE.

Author

Nikita Platonov platonov@sevin.ru

Details

ursa_open is a synonym to open_gdal. Generally, both function names are abridged version of ursa_open_dgal.

open_gdal doesn't read data. Data can be read later using Extract operator [.

If argument fname is ENVI .hdr Labelled Raster then either open_gdal or open_envi can be used. The former provides external implementation for data reading via GDAL in rgdal package.

See Also

close, open_envi, read_gdal.

Examples

Run this code
session_grid(NULL)
# fname1 <- system.file("pictures/cea.tif",package="rgdal")
fname1 <- system.file("tif/geomatrix.tif",package="sf")
message(fname1)
a1 <- open_gdal(fname1)
print(a1)
print(a1[])
close(a1)
# fname2 <- system.file("pictures/test_envi_class.envi",package="rgdal")
fname2 <- tempfile(fileext=".")
a <- ursa_dummy(1,resetGrid=TRUE)
b <- colorize(a[a>91],stretch="equal",name=format(Sys.Date()+seq(0,6),"%A %d"))
write_envi(b,fname2)
message(fname2)
b1 <- open_gdal(fname2)
b2 <- open_envi(fname2)
print(b1)
print(b2)
print(c('The same grid?'=identical(ursa_grid(b1),ursa_grid(b2))
       ,'The same data?'=identical(ursa_value(b1[]),ursa_value(b2[]))))
close(b1,b2)
envi_remove(fname2)

Run the code above in your browser using DataLab