\HeaderA{GDALReadOnlyDataset-class}{Class "GDALReadOnlyDataset"}{GDALReadOnlyDataset.Rdash.class}
\aliasA{dim,GDALReadOnlyDataset-method}{GDALReadOnlyDataset-class}{dim,GDALReadOnlyDataset.Rdash.method}
\aliasA{displayDataset}{GDALReadOnlyDataset-class}{displayDataset}
\aliasA{GDAL.close}{GDALReadOnlyDataset-class}{GDAL.close}
\aliasA{GDAL.open}{GDALReadOnlyDataset-class}{GDAL.open}
\aliasA{getColorTable}{GDALReadOnlyDataset-class}{getColorTable}
\aliasA{getDriver}{GDALReadOnlyDataset-class}{getDriver}
\aliasA{getGeoTransFunc}{GDALReadOnlyDataset-class}{getGeoTransFunc}
\aliasA{initialize,GDALReadOnlyDataset-method}{GDALReadOnlyDataset-class}{initialize,GDALReadOnlyDataset.Rdash.method}
\keyword{classes}{GDALReadOnlyDataset-class}
\begin{Description}\relax
\code{GDALReadOnlyDataset} is the base class for a GDAL Dataset
classes. Only read operations are supported. Both \code{GDALDataset}
and \code{GDALTransientDataset} inherit these read operations while
providing additional write operations (see
\code{\LinkA{GDALDataset-class}{GDALDataset.Rdash.class}}). \code{GDALReadOnlyDataset-class} inherits
from \code{\LinkA{GDALMajorObject-class}{GDALMajorObject.Rdash.class}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
GDAL.close(dataset)
GDAL.open(filename)
getDriver(dataset)
displayDataset(x, offset = c(0, 0), region.dim = dim(x),
                           reduction = 1, band = NULL, col = NULL,
                           max.dim = 500, ...)
getColorTable(dataset, band = 1)
getGeoTransFunc(dataset)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{dataset}] An object inheriting from class 'GDALReadOnlyDataset'
\item[\code{filename}] A string giving the file to read from
\item[\code{x}] An object inheriting from class 'GDALReadOnlyDataset'
\item[\code{offset}] Number of rows and columns from the origin (usually the
upper left corner) to begin reading from
\item[\code{region.dim}] The number of rows and columns to read from the
dataset
\item[\code{reduction}] scaling parameter for region.dim
\item[\code{band}] The band number (1-based) to read from
\item[\code{col}] a vector of colours or a colour function such as rainbow
\item[\code{max.dim}] another scaling parameter
\item[\code{...}] other plotting parameters passed through
\item[\code{}] 
\item[\code{}] 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{GDAL.open} and \code{GDAL.close} are shorter versions of \code{new("GDALReadOnlyDataset", ...)} and \code{closeDataset()}. Because \code{GDAL.close} through \code{closeDataset()} uses the finalization mechanism to destroy the handles to the dataset and its driver, messages such as:

"Closing GDAL dataset handle 0x8ff7900...  destroyed ... done."

may appear when \code{GDAL.close} is run, or at some later stage. 
\code{getDriver} returns an object inheriting from class 'GDALDriver'.
\code{displayDataset} and its use in \code{plot} for a pixmap object to produce a plot of the dataset, returning a pixmap object.
\code{getColorTable} returns the dataset colour table (currently does not support RGB imaging).
\code{getGeoTransFunc} returns a warping function.
\end{Details}
\begin{Section}{Objects from the Class}
Objects can be created by calls of the form \code{new("GDALReadOnlyDataset", filename, handle)}.
~~ describe objects here ~~
\end{Section}
\begin{Section}{Slots}
\describe{
\item[\code{handle}:] Object of class \code{"externalptr", from class "GDALMajorObject"} ~~ 
}
\end{Section}
\begin{Section}{Extends}
Class \code{"GDALMajorObject"}, directly.
\end{Section}
\begin{Section}{Methods}
\describe{
\item[closeDataset] \code{signature(dataset = "GDALReadOnlyDataset")}: ... 
\item[dim] \code{signature(x = "GDALReadOnlyDataset")}: ... 
\item[initialize] \code{signature(.Object = "GDALReadOnlyDataset")}: ... 
}
\end{Section}
\begin{Author}\relax
Timothy H. Keitt, modified by Roger Bivand
\end{Author}
\begin{References}\relax
\url{http://keittlab.bio.sunysb.edu/R/GDAL/}, \url{http://www.remotesensing.org/gdal/}
\end{References}
\begin{SeeAlso}\relax
See also \code{\LinkA{GDALDriver-class}{GDALDriver.Rdash.class}}, \code{\LinkA{GDALDataset-class}{GDALDataset.Rdash.class}}, \code{\LinkA{GDALTransientDataset-class}{GDALTransientDataset.Rdash.class}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
logo <- system.file("pictures/logo.jpg", package="rgdal")[1]
x <- new("GDALReadOnlyDataset", logo)
dim(x)
plot(density(getRasterTable(x)$band1))
displayDataset(x)
displayDataset(x, col=function(x){rev(cm.colors(x))})
im <- displayDataset(x, col=function(x){rev(cm.colors(x))}, reset.par=FALSE)
contour(1:attr(im, "size")[2], 1:attr(im, "size")[1],
 t(attr(im, "index"))[,attr(im, "size")[1]:1], nlevels = 1,
 levels = 100, col = 'black', add = TRUE)
GDAL.close(x)
logo <- system.file("pictures/Rlogo.jpg", package="rgdal")[1]
x <- new("GDALReadOnlyDataset", logo)
dim(x)
displayDataset(x)
GDAL.close(x)
\end{ExampleCode}
\end{Examples}

