GDALReadOnlyDataset-class       package:rgdal       R Documentation

_C_l_a_s_s "_G_D_A_L_R_e_a_d_O_n_l_y_D_a_t_a_s_e_t"

_D_e_s_c_r_i_p_t_i_o_n:

     'GDALReadOnlyDataset' is the base class for a GDAL Dataset
     classes. Only read operations are supported. Both 'GDALDataset'
     and 'GDALTransientDataset' inherit these read operations while
     providing additional write operations (see 'GDALDataset-class').
     'GDALReadOnlyDataset-class' inherits from 'GDALMajorObject-class'.

_U_s_a_g_e:

     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)

_A_r_g_u_m_e_n_t_s:

 dataset: An object inheriting from class 'GDALReadOnlyDataset'

filename: A string giving the file to read from

       x: An object inheriting from class 'GDALReadOnlyDataset'

  offset: Number of rows and columns from the origin (usually the upper
          left corner) to begin reading from

region.dim: The number of rows and columns to read from the dataset

reduction: scaling parameter for region.dim

    band: The band number (1-based) to read from

     col: a vector of colours or a colour function such as rainbow

 max.dim: another scaling parameter

     ...: other plotting parameters passed through

        : 

        : 

_D_e_t_a_i_l_s:

     'GDAL.open' and 'GDAL.close' are shorter versions of
     'new("GDALReadOnlyDataset", ...)' and 'closeDataset()'. Because
     'GDAL.close' through '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 'GDAL.close' is run, or at some later stage. 
     'getDriver' returns an object inheriting from class 'GDALDriver'.
     'displayDataset' and its use in 'plot' for a pixmap object to
     produce a plot of the dataset, returning a pixmap object.
     'getColorTable' returns the dataset colour table (currently does
     not support RGB imaging). 'getGeoTransFunc' returns a warping
     function.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form
     'new("GDALReadOnlyDataset", filename, handle)'. ~~ describe
     objects here ~~

_S_l_o_t_s:

     '_h_a_n_d_l_e': Object of class '"externalptr", from class
          "GDALMajorObject"' ~~ 

_E_x_t_e_n_d_s:

     Class '"GDALMajorObject"', directly.

_M_e_t_h_o_d_s:

     _c_l_o_s_e_D_a_t_a_s_e_t 'signature(dataset = "GDALReadOnlyDataset")': ... 

     _d_i_m 'signature(x = "GDALReadOnlyDataset")': ... 

     _i_n_i_t_i_a_l_i_z_e 'signature(.Object = "GDALReadOnlyDataset")': ... 

_A_u_t_h_o_r(_s):

     Timothy H. Keitt, modified by Roger Bivand

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://keittlab.bio.sunysb.edu/R/GDAL/>, <URL:
     http://www.remotesensing.org/gdal/>

_S_e_e _A_l_s_o:

     See also 'GDALDriver-class', 'GDALDataset-class',
     'GDALTransientDataset-class'.

_E_x_a_m_p_l_e_s:

     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)

