Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > dabb57319acb4393549d883bdd5bc220 > files > 95

libgdal0-devel-1.1.8-2mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>GDAL Data Model</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.3-20001105 on Sat Dec 21 14:02:03 2002 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><a name="gdal_datamodel"><h2>GDAL Data Model</h2></a>

<p>
This document attempts to describe the GDAL data model. That is the types of information that a GDAL data store can contain, and their  semantics.
<p>

<p>
<h2>Dataset</h2>

<p>
A dataset (represented by the <a class="el" href="class_GDALDataset.html">GDALDataset</a> class) is an assembly of  related raster bands and some information common to them all. In particular the dataset has a concept of the raster size (in pixels and lines) that applies to all the bands. The dataset is also responsible for the  georeferencing transform and coordinate system definition of all bands. The dataset itself can also have associated metadata, a list of name/value pairs in string form.
<p>
Note that the GDAL dataset, and raster band data model is loosely  based on the OpenGIS Grid Coverages specification.
<p>
<h3>Coordinate System</h3>

<p>
Dataset coordinate systems are represented as OpenGIS Well Known Text strings. This can contain:
<p>
<ul>
 <li> An overall coordinate system name.  <li> A geographic coordinate system name.  <li> A datum identifier.  <li> An ellipsoid name, semi-major axis, and inverse flattening.  <li> A prime meridian name and offset from Greenwich.  <li> A projection method type (ie. Transverse Mercator).  <li> A list of projection parameters (ie. central_meridian).  <li> A units name, and conversion factor to meters or radians.  <li> Names and ordering for the axes.  <li> Codes for most of the above in terms of predefined coordinate systems from authorities such as EPSG.  </ul>

<p>
For more information on OpenGIS WKT coordinate system definitions, and  mechanisms to manipulate them, refer to the
<p>
<a href="http://gdal.velocet.ca/projects/opengis/ogrhtml/osr_tutorial.html">
osr_tutorial</a> document and/or the OGRSpatialReference class documentation.
<p>
The coordinate system returned by <a class="el" href="class_GDALDataset.html#a6">GDALDataset::GetProjectionRef</a>()  describes the georeferenced coordinates implied by the affine georeferencing transform returned by <a class="el" href="class_GDALDataset.html#a8">GDALDataset::GetGeoTransform</a>(). The coordinate system returned by <a class="el" href="class_GDALDataset.html#a14">GDALDataset::GetGCPProjection</a>() describes the  georeferenced coordinates of the GCPs returned by <a class="el" href="class_GDALDataset.html#a15">GDALDataset::GetGCPs</a>().
<p>
Note that a returned coordinate system strings of "" indicates nothing is known about the georeferencing coordinate system.
<p>
<h3>Affine GeoTransform</h3>

<p>
GDAL datasets have two ways of describing the relationship between raster positions (in pixel/line coordinates) and georeferenced coordinates. The first, and most commonly used is the affine transform (the other is GCPs).
<p>
The affine transform consists of six coefficients returned by  <a class="el" href="class_GDALDataset.html#a8">GDALDataset::GetGeoTransform</a>() which map pixel/line coordinates into  georeferenced space using the following relationship:
<p>
<pre>
    Xgeo = GT(0) + Xpixel*GT(1) + Yline*GT(2)
    Ygeo = GT(3) + Xpixel*GT(4) + Yline*GT(5)
</pre>
<p>
In case of north up images, the GT(2) and GT(4) coefficients are zero, and the GT(1) is pixel width, and GT(5) is pixel height. The (GT(0),GT(3)) position is the top left corner of the top left pixel of the raster.
<p>
<h3>GCPs</h3>

<p>
A dataset can have a set of control points relating one or more positions on the raster to georeferenced coordinates. All GCPs share a georeferencing coordinate system (returned by <a class="el" href="class_GDALDataset.html#a14">GDALDataset::GetGCPProjection</a>()). Each GCP (represented as the <a class="el" href="struct_GDAL_GCP.html">GDAL_GCP</a> class) contains the following:
<p>
<pre>
typedef struct
{
    char	*pszId; 
    char	*pszInfo;
    double 	dfGCPPixel;
    double	dfGCPLine;
    double	dfGCPX;
    double	dfGCPY;
    double	dfGCPZ;
} <a class="el" href="struct_GDAL_GCP.html">GDAL_GCP</a>;
</pre>
<p>
The pszId string is intended to be a unique (and often, but not always numerical) identifier for the GCP within the set of GCPs on this dataset. The pszInfo is usually an empty string, but can contain any user defined text associated with the GCP. Potentially this can also contain machine  parsable information on GCP status though that isn't done at this time.
<p>
The (Pixel,Line) position is the GCP location on the raster. The (X,Y,Z) position is the associated georeferenced location with the Z often being zero.
<p>
The GDAL data model does not imply a transformation mechanism that must be generated from the GCPs ... this is left to the application. However 1st to 5th order polynomials are common.
<p>
Normally a dataset will contain either an affine geotransform, GCPs or neither. It is uncommon to have both, and it is undefined which is  authoritative.
<p>
<h3>Metadata</h3>

<p>
GDAL metadata is auxilary format and application specific textual data kept as a list of name/value pairs. The names are required to be well  behaved tokens (no spaces, or odd characters). The values can be of any length, and contain anything except an embedded null (ASCII zero).
<p>
The metadata handling system is well tuned to handling very large bodies of metadata. Handling of more than 100K of metadata for a dataset is likely to lead to performance degredation.
<p>
Over time there will be some well known names defined with established semantics; however, that has not occured at this time.
<p>
Some formats will support generic (user defined) metadata, while other format drivers will map specific format fields to metadata names. For instance the TIFF driver returns a few information tags as metadata including the date/time field which is returned as:
<p>
<pre>
TIFFTAG_DATETIME=1999:05:11 11:29:56
</pre>
<p>
<h2>Raster Band</h2>

<p>
A raster band is represented in GDAL with the <a class="el" href="class_GDALRasterBand.html">GDALRasterBand</a> class. It  represents a single raster band/channel/layer. It does not necessarily represent a whole image. For instance, a 24bit RGB image would normally be represented as a dataset with three bands, one for red, one for green and one for blue.
<p>
A raster band has the following properties:
<p>
<ul>

<p>
<li> A width and height in pixels and lines. This is the same as that  defined for the dataset, if this is a full resolution band.
<p>
<li> A datatype (GDALDataType). One of Byte, UInt16, Int16, UInt32, Int32,  Float32, Float64, and the complex types CInt16, CInt32, CFloat32, and CFloat64.
<p>
<li> A block size. This is a preferred (efficient) access chunk size. For  tiled images this will be one tile. For scanline oriented images this will  normally be one scanline.
<p>
<li> A list of name/value pair metadata in the same format as the dataset, but of information that is potentially specific to this dataset.
<p>
<li> An optional description string.
<p>
<li> An optional list of category names (effectively class names in a  thematic image).
<p>
<li> An optional minimum and maximum value.
<p>
<li> An optional offset and scale for transforming raster values into meaning ful values (ie translate height to meters)
<p>
<li> An optional raster unit name. For instance, this might indicate linear  units for elevation data.
<p>
<li> A color interpretation for the band. This is one of:
<p>
<ul>
  <li> GCI_Undefined: the default, nothing is known. <li> GCI_GrayIndex: this is an independent grayscale image <li> GCI_PaletteIndex: this raster acts as an index into a color table <li> GCI_RedBand: this raster is the red portion of an RGB or RGBA image <li> GCI_GreenBand: this raster is the green portion of an RGB or RGBA image <li> GCI_BlueBand: this raster is the blue portion of an RGB or RGBA image <li> GCI_AlphaBand: this raster is the alpha portion of an RGBA image <li> GCI_HueBand: this raster is the hue of an HLS image <li> GCI_SaturationBand: this raster is the saturation of an HLS image <li> GCI_LightnessBand: this raster is the hue of an HLS image <li> GCI_CyanBand: this band is the cyan portion of a CMY or CMYK image <li> GCI_MagentaBand: this band is the magenta portion of a CMY or CMYK image <li> GCI_YellowBand: this band is the yellow portion of a CMY or CMYK image <li> GCI_BlackBand: this band is the black portion of a CMYK image.  </ul>

<p>
<li> A color table, described in more detail later.
<p>
<li> Knowledge of reduced resolution overviews (pyramids) if available.
<p>
</ul>

<p>
<h3>Color Table</h3>

<p>
A color table conists of zero or more color entries described in C by the following structure:
<p>
<pre>
typedef struct
{
    /- gray, red, cyan or hue -/
    short      c1;      

    /- green, magenta, or lightness -/ 
    short      c2;      

    /- blue, yellow, or saturation -/
    short      c3;      

    /- alpha or blackband -/
    short      c4; 
} <a class="el" href="struct_GDALColorEntry.html">GDALColorEntry</a>;
</pre>
<p>
The color table also has a palette interpretation value (GDALPaletteInterp) which is one of the following values, and indicates how the c1/c2/c3/c4 values of a color entry should be interpreted.
<p>
<ul>
 <li> GPI_Gray: Use c1 as grayscale value.  <li> GPI_RGB: Use c1 as red, c2 as green, c3 as blue and c4 as alpha. <li> GPI_CMYK: Use c1 as cyan, c2 as magenta, c3 as yellow and c4 as black.  <li> GPI_HLS: Use c1 as hue, c2 as lightness, and c3 as saturation.  </ul>

<p>
To associate a color with a raster pixel, the pixel value is used as a subscript into the color table. That means that the colors are always applied starting at zero and accending. There is no provision for indicating a prescaling mechanism before looking up in the color table.
<p>
<h3>Overviews</h3>

<p>
A band may have zero or more overviews. Each overview is represented as a "free standing" <a class="el" href="class_GDALRasterBand.html">GDALRasterBand</a>. The size (in pixels and lines) of the  overview will be different than the underlying raster, but the geographic region covered by overviews is the same as the full resolution band.
<p>
The overviews are used to display reduced resolution overviews more quickly than could be done by reading all the full resolution data and downsampling.
<p>
Bands also have a HasArbitraryOverviews property which is TRUE if the raster can be read at any resolution efficiently but with no distinct overview levels. This applies to some FFT encoded images, or images pulled through gateways (like OGDI) where downsampling can be done efficiently at the remote point.
<p>
<hr><address><small>Generated at Sat Dec 21 14:02:03 2002 for GDAL by
<a href="http://www.stack.nl/~dimitri/doxygen/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.3-20001105 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2000</small></address>
</body>
</html>