Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

displayDataset

Display a GDAL dataset


Description

Display a GDAL dataset allowing for subscenes and decimation, allowing very large images to be browsed

Usage

displayDataset(x, offset=c(0, 0), region.dim=dim(x), reduction = 1, 
  band = 1, col = NULL, reset.par = TRUE, max.dim = 500, ...)

Arguments

x

a three-band GDALReadOnlyDataset object

offset

Number of rows and columns from the origin (usually the upper left corner) to begin reading from; presently ordered (y,x) - this may change

region.dim

The number of rows and columns to read from the dataset; presently ordered (y,x) - this may change

reduction

a vector of length 1 or 2 recycled to 2 for decimating the input data, 1 retains full resultion, higher values decimate

band

The band number (1-based) to read from

col

default NULL, attempt to use band colour table and default to grey scale if not available

reset.par

default TRUE - reset par() settings on completion

max.dim

default 500, forcing the image to a maximum dimension of the value

...

arguments passed to image.default()

Value

a list of the image data, the colour table, and the par() values on entry.

Author(s)

Tim Keitt

References

Examples

## Not run: 
logo <- system.file("pictures/Rlogo.jpg", package="rgdal")[1]
x <- GDAL.open(logo)
opar <- par(no.readonly=TRUE)
par(mfrow=c(2,2))
displayDataset(x, band=1, reset.par=FALSE)
displayDataset(x, band=2, reset.par=FALSE)
#displayDataset(x, band=3, reset.par=TRUE)
par(opar)
dx <- RGB2PCT(x, band=1:3)
displayDataset(dx, reset.par=FALSE)
GDAL.close(x)
GDAL.close(dx)

## End(Not run)

rgdal

Bindings for the 'Geospatial' Data Abstraction Library

v1.5-23
GPL (>= 2)
Authors
Roger Bivand [cre, aut] (<https://orcid.org/0000-0003-2392-6140>), Tim Keitt [aut], Barry Rowlingson [aut, ctb], Edzer Pebesma [ctb], Michael Sumner [ctb], Robert Hijmans [ctb], Daniel Baston [ctb], Even Rouault [cph, ctb], Frank Warmerdam [cph, ctb], Jeroen Ooms [ctb], Colin Rundel [ctb]
Initial release
2021-02-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.