Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 7fd7c575020aa78a8e2e309ea8909f43 > files > 551

gdal-1.6.2-6.fc13.i686.rpm

<html>
<head>
<title>GTiff -- GeoTIFF File Format</title>
</head>

<body bgcolor="#ffffff">

<h1>GTiff -- GeoTIFF File Format</h1>

Most forms of TIFF and GeoTIFF files are supported by GDAL for reading, and
somewhat less varieties can be written.<p>

When built with internal libtiff or with libtiff >= 4.0, GDAL also supports
reading and writing BigTIFF files (evolution of the TIFF format to support files
larger than 4 GB).</p>

Currently band types of Byte, UInt16, Int16, UInt32, Int32, Float32, Float64, 
CInt16, CInt32, CFloat32 and CFloat64 are supported for
reading and writing.  
Paletted images will return palette information associated with
the band.  The compression formats listed below should be supported for
reading as well. <p>

As well, one bit files, and some other unusual formulations of GeoTIFF file,
such as YCbCr color model files, are automatically translated into RGBA
(red, green, blue, alpha) form, and treated as four eight bit bands. <p>

<h2>Georeferencing</h2>

Most GeoTIFF projections should be supported, with the caveat that in order
to translate uncommon Projected, and Geographic coordinate systems into 
OGC WKT it is necessary to have the EPSG .csv files available.  They must
be found at the location pointed to by the GEOTIFF_CSV environment variable.
<p>

Georeferencing from GeoTIFF is supported in the form of one tiepoint and
pixel size, a transformation matrix, or a list of GCPs.<p>

If no georeferencing
information is available in the TIFF file itself, GDAL will also check for,
and use an ESRI <a href="frmt_various.html#WLD">world file</a> with the
extention .tfw, .tifw/.tiffw or .wld, as well as a MapInfo .tab file (only control
points used, Coordsys ignored).<P>

<h2>Internal nodata masks</h2> (from GDAL 1.6.0)<p>

TIFF files can contain internal transparency masks. The GeoTIFF driver
recognizes an internal directory as being a transparency mask when the
FILETYPE_MASK bit value is set on the TIFFTAG_SUBFILETYPE tag.
According to the TIFF specification, such internal transparency masks
contain 1 sample of 1-bit data. Although the TIFF specification allows
for higher resolutions for the internal transparency mask, the GeoTIFF
driver only supports internal transparency masks of the same dimensions
as the main image. Transparency masks of internal overviews are also
supported.<p>

When the GDAL_TIFF_INTERNAL_MASK environment variable is set to YES and
the GeoTIFF file is opened in update mode, the CreateMaskBand() method
on a TIFF dataset or rasterband will create an internal transparency mask.
Otherwise, the default behaviour of nodata mask creation will be used,
that is to say the creation of a .msk file, as per
<a href="http://trac.osgeo.org/gdal/wiki/rfc15_nodatabitmask">RFC 15</a><p>

<h2>Overviews</h2>

The GeoTIFF driver supports reading, creation and update of internal overviews.
Internal overviews can be created on GeoTIFF files opened in update mode
(with gdaladdo for instance). If the GeoTIFF file is opened as read only,
the creation of overviews will be done in an external .ovr file.
Overview are only updated on request with the BuildOverviews() method.<p>

(From GDAL 1.6.0) If a GeoTIFF file has a transparency mask and the GDAL_TIFF_INTERNAL_MASK
environment variable is set to YES and the GeoTIFF file is opened in update mode,
BuildOverviews() will automatically create overviews for the internal transparency mask.
These overviews will be refreshed by further calls to BuildOverviews() even if
GDAL_TIFF_INTERNAL_MASK is not set to YES.<p>

<h2>Creation Issues</h2>

GeoTIFF files can be created with any GDAL defined band type, including
the complex types.  Created files may have any number of bands.  Files 
with exactly 3 bands will be
given a photometric interpretation of RGB, files with exactly four bands
will have a photometric interpretation of RGBA, while all other combinations 
will have a photometric interpretation of MIN_IS_WHITE.  Files with
pseudo-color tables, or GCPs can currently only be created when creating from 
an existing GDAL dataset with those objects (GDALDriver::CreateCopy()).<p>

Note that the GeoTIFF format does not support parametric description of datums,
so TOWGS84 parameters in coordinate systems are lost in GeoTIFF format.<p>

<h3>Creation Options</h3>

<ul>

<li> <b>TFW=YES</b>: Force the generation of an associated ESRI world
file (.tfw).See a <a href="frmt_various.html#WLD">World Files</a> section
for details.<p>

<li> <b>INTERLEAVE=[BAND,PIXEL]</b>: By default TIFF files with pixel
interleaving (PLANARCONFIG_CONTIG in TIFF terminology) are created.  These
are slightly less efficient than BAND interleaving for some purposes, but 
some applications only support pixel interleaved TIFF files.<p>

<li> <b>TILED=YES</b>: By default stripped TIFF files are created.  This
option can be used to force creation of tiled TIFF files.<p>

<li> <b>BLOCKXSIZE=n</b>: Sets tile width, defaults to 256.<p>

<li> <b>BLOCKYSIZE=n</b>: Set tile or strip height.  Tile height defaults to
256, strip height defaults to a value such that one strip is 8K or less. <p>

<li> <b>NBITS=n</b>: Create a file with less than 8 bits per sample by passing a value from 1 to 7.  The apparent pixel type should be Byte. From GDAL 1.6.0, values of n=9...15 (UInt16 type) and n=17...31 (UInt32 type) are also accepted. <p>

<li> <b>COMPRESS=[JPEG/LZW/PACKBITS/DEFLATE/CCITTRLE/CCITTFAX3/CCITTFAX4/NONE]</b>: 
Set the compression to use.  JPEG should only be used with Byte data.  The
CCITT compression should only be used with 1bit (NBITS=1) data.  None is the 
default.<p>

<li> <b>PREDICTOR=[1/2/3]</b>: Set the predictor for LZW or DEFLATE compression. The default is 1 (no predictor), 2 is horizontal differencing and 3 is floating point prediction.<p>

<li> <b>SPARSE_OK=TRUE/FALSE</b> (From GDAL 1.6.0): Should newly created files be allowed to be sparse?  Sparse files have 0 tile/strip offsets for blocks never written and save space; however, most non-GDAL packages cannot read such files.  The default is FALSE.<p>

<li> <b>JPEG_QUALITY=[1-100]</b>:  Set the JPEG quality when using JPEG compression.  A value of 100 is best quality (least compression), and 1 is worst quality (best compression).  The default is 75.<p>

<li> <b>ZLEVEL=[1-9]</b>:  Set the level of compression when using DEFLATE compression. A value of 9 is best, and 1 is least compression. The default is 6.<p>

<li>
<b>PHOTOMETRIC=[MINISBLACK/MINISWHITE/RGB/CMYK/YCBCR/CIELAB/ICCLAB/ITULAB]</b>: 
Set the photometric interpretation tag. Default is MINISBLACK, but if the
input image has 3 or 4 bands of Byte type, then RGB will be selected. You can
override default photometric using this option.<p>

<li> <b>ALPHA=YES</b>: The first "extrasample" is marked as being alpha if
there are any extra samples.  This is necessary if you want to produce
a greyscale TIFF file with an alpha band (for instance). <p>

<li> <b>PROFILE=[GDALGeoTIFF/GeoTIFF/BASELINE]</b>: Control what non-baseline
tags are emitted by GDAL.
<ul>
<li>With <tt>GDALGeoTIFF</tt> (the default) various GDAL custom tags may be written.</li>
<li>With <tt>GeoTIFF</tt> only GeoTIFF tags will be added to the baseline.</li>
<li>With <tt>BASELINE</tt> no GDAL or GeoTIFF tags will be written.  BASELINE is occationally useful when writing files to
be read by applications intolerant of unrecognised tags.</li>
</ul>
<p>

<li> <b>BIGTIFF=YES/NO/IF_NEEDED/IF_SAFER</b>: Control whether the created file is a BigTIFF or a classic TIFF.
<ul>
<li>YES forces BigTIFF.</li>
<li>NO forces classic TIFF.</li>
<li>IF_NEEDED will only create a BigTIFF if it is clearly needed (uncompressed, and image larger than 4GB).</li>
<li>IF_SAFER will create BigTIFF if the resulting file *might* exceed 4GB.</li>
</ul><p>
BigTIFF is a TIFF variant which can contain more than 4GiB of data (size of classic TIFF is limited by that value). This option is available if GDAL is built with libtiff library version 4.0 or higher (which is the case of the internal libtiff version from GDAL >= 1.5.0).  The default is IF_NEEDED. (IF_NEEDED and IF_SAFER are available from GDAL 1.6.0).<p>
When creating a new GeoTIFF with no compression, GDAL computes in advance the
size of the resulting file. If that computed file size is over 4GiB, GDAL will automatically
decide to create a BigTIFF file. However, when compression is used, it is not possible in
advance to known the final size of the file, so classical TIFF will be chosen. In
that case, the user must explicitely require the creation of a BigTIFF with BIGTIFF=YES
if he anticipates the final file to be too big for classical TIFF format.
If BigTIFF creation is not explicitely asked or guessed and that the resulting file is too big for classical TIFF,
libtiff will fail with an error message like "TIFFAppendToStrip:Maximum TIFF file size exceeded".<p>

<li> <b>PIXELTYPE=[DEFAULT/SIGNEDBYTE]</b>: By setting this to SIGNEDBYTE, a 
new Byte file can be forced to be written as signed byte.<p>

<!-- Commented for the moment. Not sure we want to advertize that
<li> <b>ENDIANNESS=[NATIVE/INVERTED/LITTLE/BIG]</b>: Set the endianness of the
TIFF file. By default, the native endianness of the host running GDAL will be
used. Primarily intended for debugging & test purposes</p>
-->

</ul>

<h3>About JPEG compression of RGB images </h3>

When translating a RGB image to JPEG-In-TIFF, using PHOTOMETRIC=YCBCR can make the size
of the image typically 2 to 3 times smaller than the default photometric value (RGB).
When using PHOTOMETRIC=YCBCR, the INTERLEAVE option must be kept to its default value (PIXEL),
otherwise libtiff will fail to compress the data.
<p>
Note also that the dimensions of the tiles or strips must be a multiple of 8 for PHOTOMETRIC=RGB or 16 for PHOTOMETRIC=YCBCR

<hr>

See Also:<p>

<ul>
<li> <a href="http://www.remotesensing.org/geotiff/geotiff.html">GeoTIFF Information Page</a>
<li> <a href="http://www.remotesensing.org/libtiff/">libtiff Page</a>
<li> <a href="http://www.awaresystems.be/imaging/tiff/bigtiff.html">
	Details on BigTIFF file format</a>

</ul>

</body>
</html>