#ifndef DOXYGEN_SKIP
/* $Id: gdal_utilities.dox 13062 2007-11-26 14:40:34Z dron $ */
#endif /* DOXYGEN_SKIP */

/*! 
\page gdal_utilities GDAL Utilities

The following utility programs are distributed with GDAL. 

<ul>
<li> \ref gdalinfo - report information about a file.
<li> \ref gdal_translate - Copy a raster file, with control of output format.
<li> \ref gdaladdo - Add overviews to a file.
<li> \ref gdalwarp - Warp an image into a new coordinate system.
<li> \ref gdaltindex - Build a MapServer raster tileindex.
<li> \ref gdal_contour - Contours from DEM.
<li> \ref rgb2pct - Convert a 24bit RGB image to 8bit paletted.
<li> \ref pct2rgb - Convert an 8bit paletted image to 24bit RGB.
<li> \ref gdal_merge - Build a quick mosaic from a set of images.
<li> \ref gdal2tiles - Create a TMS tile structure, KML and simple web viewer.
<li> \ref gdal_rasterize - Rasterize vectors into raster file.
<li> \ref gdaltransform - Transform coordinates.
<li> \ref nearblack - Convert nearly black/white borders to exact value.
<li> \ref gdal_retile - Retiles a set of tiles and/or build tiled pyramid levels.
<li> \ref gdal_grid - Create raster from the scattered data.
<li> \ref gdal-config - Get options required to build software using GDAL.
</ul>

\section gdal_utilities_creating Creating New Files

Access an existing file to read it is generally quite simple.  Just
indicate the name of the file or dataset on the commandline.  However, 
creating a file is more complicated.  It may be necessary to indicate the
the format to create, various creation options affecting how it will
be created and perhaps a coordinate system to be assigned.  Many of 
these options are handled similarly by different GDAL utilities, and are
introduced here. <p>

<dl>
<dt> <b>-of</b> <i>format</i></dt><dd> 
Select the format to create the new file as.  The formats are assigned short 
names such as GTiff (for GeoTIFF) or HFA (for Erdas Imagine).  The list of 
all format codes can be listed with the <b>--formats</b> switch.  Only
formats list as "(rw)" (read-write) can be written.<p>
Many utilities default
to creating GeoTIFF files if a format is not specified.  File extensions
are not used to guess output format, nor are extensions generally added
by GDAL if not indicated in the filename by the user. 
</dd>

<dt> <b>-co</b> <i>NAME=VALUE</i></dt><dd> 
Many formats have one or more optional creation options that can be used
to control particulars about the file created.  For instance, the GeoTIFF
driver supports creation options to control compression, and whether the file
should be tiled.<p>
The creation options available vary by format driver, and some simple 
formats have no creation options at all.  A list of options supported
for a format can be listed with the "--format <format>" commandline
option but the web page for the format is the definitive source of 
information on driver creation options.<p>
</dd>

<dt> <b>-a_srs</b> <i>SRS</i></dt><dd> 
Several utilities, (gdal_translate and gdalwarp) include the ability
to specify coordinate systems with commandline options like
<b>-a_srs</b> (assign SRS to output), <b>-s_srs</b> (source SRS) and
<b>-t_srs</b> (target SRS).<p>
These utilities allow the coordinate system (SRS = spatial reference system)
to be assigned in a variety of formats.<p>

<ul>
<li> <b>NAD27</b>/<b>NAD83</b>/<b>WGS84</b>/<b>WGS72</b>: 
These common geographic (lat/long) coordinate
systems can be used directly by these names. 

<li> <b>EPSG:</b><i>n</i>: Coordinate systems (projected or geographic) can
be selected based on their EPSG codes, for instance EPSG:27700 is the British
National Grid.  A list of EPSG coordinate systems can be found in the GDAL 
data files gcs.csv and pcs.csv. 

<li> <i>PROJ.4 Definitions</i>: A PROJ.4 definition string can be used
as a coordinate system.  For instance "+proj=utm +zone=11 +datum=WGS84".  
Take care to keep the proj.4 string together as a single argument to the
command (usually by double quoting). <p>

<li> <i>OpenGIS Well Known Text</i>: The Open GIS Consortium has defined
a textual format for describing coordinate systems as part of the Simple
Features specifications.  This format is the internal working format
for coordinate systems used in GDAL.  The name of a file containing a 
WKT coordinate system definition may be used a coordinate system argument,
or the entire coordinate system itself may be used as a commandline
option (though escaping all the quotes in WKT is quite challenging). <p>

<li> <i>ESRI Well Known Text</i>: ESRI uses a slight variation on OGC WKT
format in their ArcGIS product (ArcGIS .prj files), and these may be used
in a similar manner to WKT files, but the filename should be prefixed with
<b>ESRI::</b>.  For example <b>"ESRI::NAD 1927 StatePlane Wyoming West FIPS 4904.prj"</b>. <p>
</ul>
</dd>
</dl>

\section gdal_utilities_switches General Command Line Switches
All GDAL command line utility programs support the following 
"general" options.<p>

<dl>
<dt> <b>--version</b></dt><dd> Report the version of GDAL and exit.</dd>

<dt> <b>--formats</b></dt><dd> List all raster formats supported by this
GDAL build (read-only and read-write) and exit. The format support is indicated
 as follows: 'ro' is read-only driver; 
'rw' is read or write (ie. supports CreateCopy);
'rw+' is read, write and update (ie. supports Create).</dd>

<dt> <b>--format</b> <i>format</i></dt><dd>
List detailed information about a single format driver.  The <i>format</i> 
should be the short name reported in the <b>--formats</b> list, such as 
GTiff.</dd>

<dt> <b>--optfile</b> <i>file</i></dt><dd>
Read the named file and substitute the contents into the commandline
options list.  Lines beginning with # will be ignored.  Multi-word arguments
may be kept together with double quotes. 
</dd>

<dt> <b>--config</b> <i>key value</i></dt><dd>
Sets the named configuration keyword to the given value, as opposed to 
setting them as environment variables.  Some common configuration keywords
are GDAL_CACHEMAX (memory used internally for caching in megabytes)
and GDAL_DATA (path of the GDAL "data" directory).  Individual drivers may
be influenced by other configuration options. 
</dd>

<dt> <b>--debug</b> <i>value</i></dt><dd>
Control what debugging messages are emitted.  A value of <i>ON</i> will
enable all debug messages.  A value of <i>OFF</i> will disable all debug
messages.  Another value will select only debug messages containing that
string in the debug prefix code. 
</dd>

<dt> <b>--help-general</b></dt><dd>
Gives a brief usage message for the generic GDAL commandline options 
and exit.
</dd>

</dl>

\htmlonly
<p>
$Id: gdal_utilities.dox 13062 2007-11-26 14:40:34Z dron $
</p>
\endhtmlonly
*/

*******************************************************************************
/*! \page gdalinfo gdalinfo

lists information about a raster dataset

\section synopsis SYNOPSIS

\verbatim
gdalinfo [--help-general] [-mm] [-stats] [-nogcp] [-nomd]
         [-noct] [-checksum] [-mdd domain]* datasetname
\endverbatim

\section description DESCRIPTION

The gdalinfo program lists various information about a GDAL supported
raster dataset. 
<dl>
<dt> <b>-mm</b></dt><dd> Force computation of the actual min/max values for each
band in the dataset.</dd>
<dt> <b>-stats</b></dt><dd> Read and display image statistics. Force computation if no statistics are stored in an image.</dd>
<dt> <b>-nogcp</b></dt><dd> Suppress ground control points list printing. It may be
useful for datasets with huge amount of GCPs, such as L1B AVHRR or HDF4 MODIS
which contain thousands of the ones.</dd>
<dt> <b>-nomd</b></dt><dd> Suppress metadata printing. Some datasets may contain a lot
of metadata strings.</dd>
<dt> <b>-noct</b></dt><dd> Suppress printing of color table.</dd>
<dt> <b>-checksum</b></dt><dd> Force computation of the checksum for each band in the dataset.</dd>
<dt> <b>-mdd domain</b></dt><dd> Report metadata for the specified domain</dd>
</dl>

The gdalinfo will report all of the following (if known):

<ul>
<li> The format driver used to access the file. 
<li> Raster size (in pixels and lines).
<li> The coordinate system for the file (in OGC WKT).
<li> The geotransform associated with the file (rotational coefficients are
currently not reported).  
<li> Corner coordinates in georeferenced, and if possible lat/long based on
the full geotransform (but not GCPs). 
<li> Ground control points.
<li> File wide (including subdatasets) metadata. 
<li> Band data types.
<li> Band color interpretations.
<li> Band block size.
<li> Band descriptions. 
<li> Band min/max values (internally known and possibly computed).
<li> Band checksum (if computation asked).
<li> Band NODATA value.
<li> Band overview resolutions available. 
<li> Band unit type (i.e.. "meters" or "feet" for elevation bands). 
<li> Band pseudo-color tables. 
</ul>

\section example EXAMPLE

\verbatim
gdalinfo ~/openev/utm.tif 
Driver: GTiff/GeoTIFF
Size is 512, 512
Coordinate System is:
PROJCS["NAD27 / UTM zone 11N",
    GEOGCS["NAD27",
        DATUM["North_American_Datum_1927",
            SPHEROID["Clarke 1866",6378206.4,294.978698213901]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-117],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1]]
Origin = (440720.000000,3751320.000000)
Pixel Size = (60.000000,-60.000000)
Corner Coordinates:
Upper Left  (  440720.000, 3751320.000) (117d38'28.21"W, 33d54'8.47"N)
Lower Left  (  440720.000, 3720600.000) (117d38'20.79"W, 33d37'31.04"N)
Upper Right (  471440.000, 3751320.000) (117d18'32.07"W, 33d54'13.08"N)
Lower Right (  471440.000, 3720600.000) (117d18'28.50"W, 33d37'35.61"N)
Center      (  456080.000, 3735960.000) (117d28'27.39"W, 33d45'52.46"N)
Band 1 Block=512x16 Type=Byte, ColorInterp=Gray
\endverbatim

\if man
\section author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/

*******************************************************************************
/*! \page gdal_translate gdal_translate

converts raster data between different formats

\section tsynopsis SYNOPSIS

\verbatim
gdal_translate [--help-general]
       [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
             CInt16/CInt32/CFloat32/CFloat64}] [-not_strict]
       [-of format] [-b band] [-outsize xsize[%] ysize[%]]
       [-scale [src_min src_max [dst_min dst_max]]]
       [-srcwin xoff yoff xsize ysize] [-projwin ulx uly lrx lry]
       [-a_srs srs_def] [-a_ullr ulx uly lrx lry] [-a_nodata value]
       [-gcp pixel line easting northing]*
       [-mo "META-TAG=VALUE"]* [-quiet] [-sds]
       [-co "NAME=VALUE"]*
       src_dataset dst_dataset
\endverbatim

\section tdescription DESCRIPTION

The gdal_translate utility can be used to convert raster data between 
different formats, potentially performing some operations like subsettings, 
resampling, and rescaling pixels in the process.

<dl>
<dt> <b>-ot</b>: <i>type</i></dt><dd> For the output bands to be of the
indicated data type.</dd>
<dt> <b>-not_strict</b>:</dt><dd> Be forgiving of mismatches and lost data
when translating to the output format.</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> Select the output format.  The default
is GeoTIFF (GTiff).  Use the short format name.</dd>
<dt> <b>-b</b> <i>band</i>:</dt><dd> Select an input band <i>band</i> for
output. Bands are numbered from 1 Multiple <b>-b</b> switches may be used
to select a set of input bands to write to the output file, or to reorder
bands.</dd>
<dt> <b>-outsize</b> <i>xsize[%] ysize[%]</i>:</dt><dd> Set the size of the output
file.  Outsize is in pixels and lines unless '%' is attached in which case it
is as a fraction of the input image size.</dd>
<dt> <b>-scale</b> <i>[src_min src_max [dst_min dst_max]]</i>:</dt><dd> Rescale the
input pixels values from the range <i>src_min</i> to <i>src_max</i> to
the range <i>dst_min</i> to <i>dst_max</i>.  If omitted the output range is
0 to 255.  If omitted the input range is automatically computed from the
source data.</dd>
<dt> <b>-srcwin</b> <i>xoff yoff xsize ysize</i>:</dt><dd> Selects a subwindow
from the source image for copying based on pixel/line location.  </dd>
<dt> <b>-projwin</b> <i>ulx uly lrx lry</i>:</dt><dd> Selects a subwindow from
the source image for copying (like <b>-srcwin</b>) but with the corners given
in georeferenced coordinates. </dd>
<dt> <b>-a_srs</b> <i>srs_def</i>:</dt><dd> Override the projection for the
output file.  The <i>srs_def</i> may be any of the usual GDAL/OGR forms,
complete WKT, PROJ.4, EPSG:n or a file containing the WKT. </dd>
<dt> <b>-a_ullr</b> <i>ulx uly lrx lry</i>:</dt><dd>
Assign/override the georeferenced bounds of the output file.  This assigns 
georeferenced bounds to the output file, ignoring what would have been derived 
from the source file.</dd>
<dt> <b>-a_nodata</b> <i>value</i>:</dt><dd>
Assign a specified nodata value to output bands.</dd>
<dt> <b>-mo</b> <i>"META-TAG=VALUE"</i>:</dt><dd> Passes a metadata key and
value to set on the output dataset if possible.</dd>
<dt> <b>-co</b> <i>"NAME=VALUE"</i>:</dt><dd> Passes a creation option to the
output format driver.  Multiple <b>-co</b> options may be listed.  See format 
specific documentation for legal creation options for each format.</dd>
<dt> <b>-gcp</b> <i>pixel line easting northing</i>:</dt><dd>
Add the indicated ground control point to the output dataset.  This option 
may be provided multiple times to provide a set of GCPs. 
</dd>
<dt> <b>-quiet</b>:</dt><dd> Suppress progress monitor and other non-error
output.</dd>
<dt> <b>-sds</b>:</dt><dd> Copy all subdatasets of this file to individual 
output files.  Use with formats like HDF or OGDI that have subdatasets.</dd>
<dt> <i>src_dataset</i>:</dt><dd>The source dataset name. It can be either
file name, URL of data source or subdataset name for multi-dataset files.</dd>
<dt> <i>dst_dataset</i>:</dt><dd> The destination file name.</dd>
</dl>

\section texample EXAMPLE

\verbatim
gdal_translate -of GTiff -co "TILED=YES" utm.tif utm_tiled.tif
\endverbatim

\if man
\section tauthor AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/

*******************************************************************************
/*! \page gdaladdo gdaladdo

builds or rebuilds overview images

\section asynopsis SYNOPSIS

\verbatim
gdaladdo [-r {nearest,average,average_mp,average_magphase,mode}]
         [--help-general] filename levels
\endverbatim

\section adescription DESCRIPTION

The gdaladdo utility can be used to build or rebuild overview images for
most supported file formats with one over several downsampling algorithms. 

<dl>
<dt> <b>-r</b>
<i>{nearest,average,average_mp,average_magphase,mode}</i>:</dt><dd>
Select a resampling algorithm.</dd>
<dt> <i>filename</i>:</dt><dd> The file to build overviews for. </dd>
<dt> <i>levels</i>:</dt><dd> A list of integral overview levels to build.  </dd>
</dl>

<i>Mode</i> is not actually implemented, and <i>average_mp</i> is unsuitable 
for use.  <i>Average_magphase</i> averages complex data in mag/phase space.  
<i>Nearest</i> and <i>average</i> are applicable to normal image data.  
<i>Nearest</i> applies a nearest neighbour (simple sampling) resampler, while
<i>average</i> computes the average of all non-NODATA contributing pixels.

Selecting a level value like <i>2</i> causes an overview level that is 1/2
the resolution (in each dimension) of the base layer to be computed.  If
the file has existing overview levels at a level selected, those levels will
be recomputed and rewritten in place.

Some format drivers do not support overviews at all.  Many format drivers
store overviews in a secondary file with the extension .ovr that is actually
in TIFF format.  The GeoTIFF driver stores overviews internally to the file 
operated on. 

Overviews created in TIFF format may be compressed using the COMPRESS_OVERVIEW 
configuration option.  All compression methods, supported by the GeoTIFF 
driver, available here. (eg --config COMPRESS_OVERVIEW DEFLATE)

Most drivers also support an alternate overview format using Erdas Imagine 
format.  To trigger this use the USE_RRD=YES configuration option.  This will 
place the overviews in an associated .aux file suitable for direct use with 
Imagine or ArcGIS as well as GDAL applications.  (eg --config USE_RRD YES)

\section aexample EXAMPLE

\htmlonly
Example:
\endhtmlonly

Create overviews, embedded in the supplied TIFF file:

\verbatim
gdaladdo -r average abc.tif 2 4 8 16
\endverbatim

Create an external compressed GeoTIFF overview file from the ERDAS .IMG file:

\verbatim
gdaladdo --config COMPRESS_OVERVIEW DEFLATE erdas.img 2 4 8 16
\endverbatim

Create an Erdas Imagine format overviews for the indicated JPEG file:

\verbatim
gdaladdo --config USE_RRD YES airphoto.jpg 3 9 27 81
\endverbatim

\if man
\section aauthor AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/

*******************************************************************************
/*! \page gdalwarp gdalwarp

simple image reprojection and warping utility

\section wsynopsis SYNOPSIS

\htmlonly
Usage: 
\endhtmlonly

\verbatim
gdalwarp 
    [-s_srs srs_def] [-t_srs srs_def] [-order n] ] [-tps] [-et err_threshold]
    [-te xmin ymin xmax ymax] [-tr xres yres] [-ts width height]
    [-wo "NAME=VALUE"] [-ot Byte/Int16/...] [-wt Byte/Int16]
    [-srcnodata "value [value...]"] [-dstnodata "value [value...]"] -dstalpha
    [-r resampling_method] [-wm memory_in_mb] [-multi] [-q]
    [-of format] [-co "NAME=VALUE"]* srcfile* dstfile
\endverbatim

\section wdescription DESCRIPTION

<p>
The gdalwarp utility is an image mosaicing, reprojection and warping
utility. The program can reproject to any supported projection,
and can also apply GCPs stored with the image if the image is "raw"
with control information.

<p>
<dl>
<dt> <b>-s_srs</b> <em>srs def</em>:</dt><dd> source spatial reference set.
The coordinate systems that can be passed are anything supported by the
OGRSpatialReference.SetFromUserInput() call, which includes EPSG PCS and GCSes
(ie. EPSG:4296), PROJ.4 declarations (as above), or the name of a .prf file
containing well known text.</dd>
<dt> <b>-t_srs</b> <em>srs_def</em>:</dt><dd> target spatial reference set.
The coordinate systems that can be passed are anything supported by the
OGRSpatialReference.SetFromUserInput() call, which includes EPSG PCS and GCSes
(ie. EPSG:4296), PROJ.4 declarations (as above), or the name of a .prf file
containing well known text.</dd>
<dt> <b>-order</b> <em>n</em>:</dt><dd> order of polynomial used for warping
(1 to 3). The default is to select a polynomial order based on the number of
GCPs.</dd>
<dt> <b>-tps</b></dt><dd>Enable use of thin plate spline transformer based on
available GCPs.  Use this <em>instead</em> of the -order switch.</dd>
<dt> <b>-et</b> <em>err_threshold</em>:</dt><dd> error threshold for
transformation approximation (in pixel units - defaults to 0.125).</dd>
<dt> <b>-te</b> <em>xmin ymin xmax ymax</em>:</dt><dd> set georeferenced
extents of output file to be created.</dd>
<dt> <b>-tr</b> <em>xres yres</em>:</dt><dd> set output file resolution (in
target georeferenced units)</dd>
<dt> <b>-ts</b> <em>width height</em>:</dt><dd> set output file size in
pixels and lines</dd>
<dt> <b>-wo</b> <em>"NAME=VALUE"</em>:</dt><dd> Set a warp options.  The 
GDALWarpOptions::papszWarpOptions docs show all options.  Multiple
 <b>-wo</b> options may be listed.</dd>
<dt> <b>-ot</b> <em>type</em>:</dt><dd> For the output bands to be of the
indicated data type.</dd>
<dt> <b>-wt</b> <em>type</em>:</dt><dd> Working pixel data type. The data type
of pixels in the source image and destination image buffers.</dd>
<dt> <b>-r</b> <em>resampling_method</em>:</dt><dd> Resampling method to use. Available methods are:
<dl>
<dt><b>near</b></dt>: <dd>nearest neighbour resampling (default, fastest
algorithm, worst interpolation quality).</dd>
<dt><b>bilinear</b></dt>: <dd>bilinear resampling.</dd>
<dt><b>cubic</b></dt>: <dd>cubic resampling.</dd>
<dt><b>cubicspline</b></dt>: <dd>cubic spline resampling.</dd>
<dt><b>lanczos</b></dt>: <dd>Lanczos windowed sinc resampling.</dd>
</dl>
<dt> <b>-srcnodata</b> <em>value [value...]</em>:</dt><dd> Set nodata masking
values for input bands (different values can be supplied for each band).  If 
more than one value is supplied all values should be quoted to keep them 
together as a single operating system argument.  Masked values will not be 
used in interpolation.  Use a value of <tt>None</tt> to ignore intrinsic nodata settings on the source dataset.</dd>
<dt> <b>-dstnodata</b> <em>value [value...]</em>:</dt><dd> Set nodata values
for output bands (different values can be supplied for each band).  If more
than one value is supplied all values should be quoted to keep them together
as a single operating system argument.  New files will be initialized to this
value and if possible the nodata value will be recorded in the output
file.</dd>
<dt> <b>-dstalpha</b>:</dt><dd> Create an output alpha band to identify 
nodata (unset/transparent) pixels. </dd>
<dt> <b>-wm</b> <em>memory_in_mb</em>:</dt><dd> Set the amount of memory (in
megabytes) that the warp API is allowed to use for caching.</dd>
<dt> <b>-multi</b>:</dt><dd> Use multithreaded warping implementation.
Multiple threads will be used to process chunks of image and perform
input/output operation simultaneously.</dd>
<dt> <b>-q</b>:</dt><dd> Be quiet.</dd>
<dt> <b>-of</b> <em>format</em>:</dt><dd> Select the output format. The default is GeoTIFF (GTiff). Use the short format name. </dd>
<dt> <b>-co</b> <em>"NAME=VALUE"</em>:</dt><dd> passes a creation option to
the output format driver. Multiple <b>-co</b> options may be listed. See
format specific documentation for legal creation options for each format.
</dd>
<dt> <em>srcfile</em>:</dt><dd> The source file name(s). </dd>
<dt> <em>dstfile</em>:</dt><dd> The destination file name. </dd>
</dl>

Mosaicing into an existing output file is supported if the output file 
already exists. 

<p>
\section wexample EXAMPLE

For instance, an eight bit spot scene stored in GeoTIFF with
control points mapping the corners to lat/long could be warped to a UTM
projection with a command like this:<p>

\verbatim
gdalwarp -t_srs '+proj=utm +zone=11 +datum=WGS84' raw_spot.tif utm11.tif
\endverbatim

For instance, the second channel of an ASTER image stored in HDF with
control points mapping the corners to lat/long could be warped to a UTM
projection with a command like this:<p>

\verbatim
gdalwarp HDF4_SDS:ASTER_L1B:"pg-PR1B0000-2002031402_100_001":2 pg-PR1B0000-2002031402_100_001_2.tif
\endverbatim

\if man
\section wauthor AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/

*******************************************************************************
/*! \page gdaltindex gdaltindex

builds a shapefile as a raster tileindex

\section isynopsis SYNOPSIS

\verbatim
gdaltindex [-tileindex field_name] [-write_absolute_path] [-skip_different_projection] index_file [gdal_file]*
\endverbatim

\section idescription DESCRIPTION

This program builds a shapefile with a record for each input raster file, 
an attribute containing the filename, and a polygon geometry outlining the
raster.  This output is suitable for use with UMN MapServer as a raster 
tileindex. 

<ul>
<li> The shapefile (index_file) will be created if it doesn't already exist, 
otherwise it will append to the existing file.
<li> The default tile index field is 'location'.
<li> Raster filenames will be put in the file exactly as they are specified
on the commandline unless the option -write_absolute_path is used.
<li> If -skip_different_projection is specified, only files with same projection ref
as files already inserted in the tileindex will be inserted.
<li> Simple rectangular polygons are generated in the same
coordinate system as the rasters.
</ul>

\section iexample EXAMPLE

\htmlonly
Example:
\endhtmlonly

\verbatim
gdaltindex doq_index.shp doq/*.tif
\endverbatim

\if man
\section wauthor AUTHOR
Frank Warmerdam <warmerdam@pobox.com>
\endif
*/

*******************************************************************************
/*! \page gdal_contour gdal_contour

builds vector contour lines from a raster elevation model

\section isynopsis SYNOPSIS

\verbatim
Usage: gdal_contour [-b <band>] [-a <attribute_name>] [-3d] [-inodata]
                    [-snodata n] [-f <formatname>] [-i <interval>]
                    [-off <offset>] [-fl <level> <level>...]
                    <src_filename> <dst_filename> 
\endverbatim

\section idescription DESCRIPTION

This program generates a vector contour file from the input raster elevation
model (DEM). 

<dl>
<dt> <b>-s_srs</b> <em>srs def</em>:</dt><dd> source spatial reference
 set. The coordinate systems that can be passed are anything supported
 by the OGRSpatialReference.SetFromUserInput() call, which includes
 EPSG PCS and GCSes (ie. EPSG:4296), PROJ.4 declarations (as above),
 or the name of a .prf file containing well known text.</dd>
</dl

<dt> <b>-b</b> <em>band</em>:</dt><dd> picks a particular band to get the DEM from.  Defaults to band 1.</dd>

<dt> <b>-a</b> <em>name</em>:</dt><dd>provides a name for the attribute in which to put the elevation. If not provided no elevation attribute is attached. </dd>
<dt> <b>-3d</b>:</dt> <dd>
      Force production of 3D vectors instead of 2D.  Includes elevation at
      every vertex.</dd>

<dt> <b>-inodata</b>:</dt> <dd> Ignore any nodata value implied in the dataset - treat all values as valid.</dd>

<dt> <b>-snodata</b> <em>value</em>:</dt><dd>
 Input pixel value to treat as "nodata". </dd>

<dt> <b>-f</b> <em>format</em>:</dt> <dd>
create output in a particular format, default is shapefiles.</dd>

<dt> <b>-i</b> <em>interval</em>:</dt><dd>
 elevation interval between contours.</dd>

<dt> <b>-off</b> <em>offset</em>:</dt><dd>
 Offset from zero relative to which to interpret intervals.</dd>

<dt> <b>-fl</b> <em>level</em>:</dt>
<dd> Name one or more "fixed levels" to extract.</dd>
</dl>

\section iexample EXAMPLE

This would create 10meter contours from the DEM data in dem.tif and produce
a shapefile in contour.shp/shx/dbf with the contour elevations in the "elev"
attribute.

\verbatim
gdal_contour -a elev dem.tif contour.shp -i 10.0
\endverbatim

\if man
\section iauthor AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/

*******************************************************************************
/*! \page gdal_rasterize gdal_rasterize

burns vector polygons into a raster

\section zsynopsis SYNOPSIS

\verbatim
Usage: gdal_rasterize [-b band] [-i]
       [-burn value] | [-a attribute_name] | [-3d]
       [-l layername]* [-where expression] [-sql select_statement]
       <src_datasource> <dst_filename>
\endverbatim

\section zdescription DESCRIPTION

This program burns vector polygons into the raster band(s) of a raster
image.  Vectors are read from OGR supported vector formats. 

<dl>
<dt> <b>-b</b> <em>band</em>: </dt><dd> 
The band(s) to burn values into.  Multiple -b arguments may be used to burn 
into a list of bands.  The default is to burn into band 1.</dd>

<dt> <b>-i</b>: </dt><dd>
Invert rasterization.  Burn the fixed burn value, or the burn value associated 
with the first feature into all parts of the image <em>not</em> iside a 
polygon.</dd>

<dt> <b>-burn</b> <em>value</em>: </dt><dd> 
A fixed value to burn into a band for all objects.  A list of -burn options 
can be supplied, one per band being written to.</dd>

<dt> <b>-a</b> <em>attribute_name</em>: </dt><dd> 
Identifies an attribute field on the features to be used for a burn in value.
The value will be burned into all output bands.</dd>

<dt> <b>-3d</b>: </dt><dd> 
Indicates that a burn value should be extracted from the "Z" values of the 
feature (not yet implemented).</dd>

<dt> <b>-l</b> <em>layername</em>: </dt><dd> 
Indicates the layer(s) from the datasource that will be used for input 
features.  May be specified multiple times, but at least one layer name or a -sql option must be specified.</dd>

<dt> <b>-where</b> <em>expression</em>: </dt><dd> 
An optional SQL WHERE style query expression to be applied to select features 
to burn in from the input layer(s). </dd>

<dt> <b>-sql</b> <em>select_statement</em>: </dt><dd> 
An SQL statement to be evaluated against the datasource to produce a
virtual layer of features to be burned in.</dd>

<dt> <em>src_datasource</em>: </dt><dd> 
Any OGR supported readable datasource.</dd>

<dt> <em>dst_filename</em>: </dt><dd> 
The GDAL supported output file.  Must support update mode access.  Currently 
gdal_rasterize cannot create new output files though that may be added eventually.</dd>

</dl>

\section zexample EXAMPLE

The following would burn all polygons from mask.shp into the RGB TIFF
file work.tif with the color red (RGB = 255,0,0).  

\verbatim
gdal_rasterize -b 1 -b 2 -b 3 -burn 255 -burn 0 -burn 0 -l mask mask.shp work.tif
\endverbatim

The following would burn all "class A" buildings into the output elevation
file, pulling the top elevation from the ROOF_H attribute.

\verbatim
gdal_rasterize -a ROOF_H -where 'class="A"' -l footprints footprints.shp city_dem.tif
\endverbatim

\if man
\section zauthor AUTHORS
Frank Warmerdam <warmerdam@pobox.com>
\endif
*/

*******************************************************************************
/*! \page rgb2pct rgb2pct.py

converts an image into a pseudo-colored image

\section rsynopsis SYNOPSIS

\verbatim
rgb2pct.py [-n colors] [-of format] source_file dest_file
\endverbatim

\section rdescription DESCRIPTION

This utility will compute an optimal pseudo-color table for a given RGB image
using a median cut algorithm on a downsampled RGB histogram.   Then it 
converts the image into a pseudo-colored image using the color table.
This conversion utilizes Floyd-Steinberg dithering (error diffusion) to 
maximize output image visual quality. 

<dl>
<dt> <b>-n</b> <i>colors</i>:</dt><dd> Select the number of colors in the generated
color table.  Defaults to 256.  Must be between 2 and 256. </dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> Format to generated (defaults to GeoTIFF).  Same
semantics as the <b>-of</b> flag for gdal_translate.  Only output formats
supporting pseudocolor tables should be used. </dd>
<dt> <i>source_file</i>:</dt><dd> The input RGB file. </dd>
<dt> <i>dest_file</i>:</dt><dd> The output pseudo-colored file that will be
created.</dd>
</dl>

NOTE: rgb2pct.py is a Python script, and will only work if GDAL was built
with Python support.  

\if man
\section iauthor AUTHOR
Frank Warmerdam <warmerdam@pobox.com>
\endif
*/

*******************************************************************************
/*! \page pct2rgb pct2rgb.py

converts an image into a pseudo-colored image

\section psynopsis SYNOPSIS

\htmlonly
Usage: 
\endhtmlonly

\verbatim
pct2rgb.py [-of format] [-b band] source_file dest_file
\endverbatim

\section pdescription DESCRIPTION

This utility will convert a pseudocolor band on the input file into an output
RGB file of the desired format. 

<dl>
<dt> <b>-of</b> <i>format</i>:</dt><dd> Format to generated (defaults to GeoTIFF).</dd>
<dt> <b>-b</b> <i>band</i>:</dt><dd> 
Band to convert to RGB, defaults to 1.</dd>
<dt> <i>source_file</i>:</dt><dd> The input file. </dd>
<dt> <i>dest_file</i>:</dt><dd> The output RGB file that will be
created.</dd>
</dl>

NOTE: pct2rgb.py is a Python script, and will only work if GDAL was built
with Python support.

\if man
\section pauthor AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/

*******************************************************************************
/*! \page gdaltransform gdaltransform
	
transforms coordinates 

\section fsynopsis SYNOPSIS

\verbatim
gdaltransform [--help-general]
	[i] [-s_srs srs_def] [-t_srs srs_def] [-order n] ] [-tps]
	[-gcp pixel line easting northing [elevation]]*
	[srcfile [dstfile]]
\endverbatim

\section fdescription DESCRIPTION

The gdaltransform utility reprojects a list of coordinates into any supported
projection,including  GCP-based transformations.

<dl>
<dt> <b>-s_srs</b> <em>srs def</em>:</dt><dd> source spatial reference set.
The coordinate systems that can be passed are anything supported by the
OGRSpatialReference.SetFromUserInput() call, which includes EPSG PCS and GCSes
(ie. EPSG:4296), PROJ.4 declarations (as above), or the name of a .prf file
containing well known text.</dd>
<dt> <b>-t_srs</b> <em>srs_def</em>:</dt><dd> target spatial reference set.
The coordinate systems that can be passed are anything supported by the
OGRSpatialReference.SetFromUserInput() call, which includes EPSG PCS and GCSes
(ie. EPSG:4296), PROJ.4 declarations (as above), or the name of a .prf file
containing well known text.</dd>
<dt> <b>-order</b> <em>n</em>:</dt><dd> order of polynomial used for warping
(1 to 3). The default is to select a polynomial order based on the number of
GCPs.</dd>
<dt> <b>-tps</b></dt><dd>Enable use of thin plate spline transformer based on
available GCPs.  Use this <em>instead</em> of the -order switch.</dd>
<dt> <b>-i</b></dt><dd>Inverse transformation: from destination to source.</dd>
<dt> <em>srcfile</em>:</dt><dd> File with source projection definition or GCP's. If
    not given, source projection is read from the command-line -s_srs or -gcp parameters </dd>
<dt> <em>dstfile</em>:</dt><dd> File with destination projection definition. </dd>
</dl>


Coordinates are read as pairs (or triples) of numbers per line from standard
input, transformed, and written out to standard output in the same way. All
transformations offered by gdalwarp are handled, including gcp-based ones.

Note that input and output must always be in decimal form.  There is currently
no support for DMS input or output.

\section fexample EXAMPLE

\verbatim
gdaltransform -s_srs epsg:28992 -t_srs epsg:31370
177502 311865
244510.77404604 166154.532871342 -1046.79270555763

\endverbatim

\if man
\section fauthor AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Jan Hartmann <j.l.h.hartmann@uva.nl>
\endif
*/
*******************************************************************************
/*! \page nearblack nearblack

convert nearly black/white borders to black

\section msynopsis SYNOPSIS

\verbatim
nearblack [-white] [-near dist] [-nb non_black_pixels]
          [-o outfile] infile
\endverbatim

\section mdescription DESCRIPTION

This utility will scan an image and try to set all pixels that are nearly
black (or nearly white) around the collar to exactly black (or white).  This
is often used to "fix up" lossy compressed airphotos so that color pixels
can be treated as transparent when mosaicing. 

<dl>
<dt> <b>-o</b> <i>outfile</i>:</dt><dd> The name of the output file to be
created.  Newly created files are currently always created with the HFA driver
(Erdas Imagine - .img)</dd>
<dt> <b>-white</b>:</dt><dd> 
Search for nearly white (255) pixels instead of nearly black pixels.
</dd>
<dt> <b>-near</b> <i>dist</i>:</dt><dd> 
Select how far from black (or white) the pixel values can be and still considered near black (white).  Defaults to 15. 
</dd>
<dt> <b>-nb</b> <i>non_black_pixels</i>:</dt><dd> 
number of non-black pixels that can be encountered before the giving up search inwards. Defaults to 2. 
</dd>
<dt> <i>infile</i>:</dt><dd> 
The input file.  Any GDAL supported format, any number of bands, normally 8bit 
Byte bands.
</dd>
</dl>

The algorithm processes the image one scanline at a time.  A scan "in" is done 
from either end setting pixels to black (white) until at least 
"non_black_pixels" pixels that are more than "dist" gray levels away from 
black (white) have been encountered at which point the scan stops.  The nearly
black (white) pixels are set to black (white). 

Note that this algorithm is only applied to horizontal scanlines, so a photo
with an indentation in the top or bottom will not have that indentation
identified.  The processing is all done in 8bit (Bytes).

If the output file is omitted, the processed results will be written back
to the input file - which must support update. 

\if man
\section mauthor AUTHORS
Frank Warmerdam <warmerdam@pobox.com>
\endif
*/

*******************************************************************************
/*! \page gdal_merge gdal_merge.py

mosaics a set of images

\section gsynopsis SYNOPSIS

\verbatim
gdal_merge.py [-o out_filename] [-of out_format] [-co NAME=VALUE]*
                     [-ps pixelsize_x pixelsize_y] [-separate] [-v] [-pct]
                     [-ul_lr ulx uly lrx lry] [-n nodata_value] [-init value]
                     [-ot datatype] [-createonly] input_files
\endverbatim

\section gdescription DESCRIPTION

This utility will automatically mosaic a set of images.  All the images must
be in the same coordinate system and have a matching number of bands, but 
they may be overlapping, and at different resolutions.

<dl>
<dt> <b>-o</b> <i>out_filename</i>:</dt><dd> The name of the output file to be
created.</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> 
Output format, defaults to GeoTIFF (GTiff). 
</dd>
<dt> <b>-co</b> <i>NAME=VALUE</i>:</dt><dd> 
Creation option for output file.  Multiple options can be specified.
</dd>
<dt> <b>-ot</b> <i>datatype</i>:</dt><dd> 
Force the output image bands to have a specific type. Use type names (ie. Byte, Int16,...)
</dd>
<dt> <b>-ps</b> <i>pixelsize_x pixelsize_y</i>:</dt><dd> Pixel size to be used for the
output file.  If not specified the resolution of the first input file will
be used.</dd>
<dt> <b>-ul_lr</b> <i>ulx uly lrx lry</i>:</dt><dd> The extents of the output file. 
If not specified the aggregate extents of all input files will be
used.</dd>
<dt>
<dt> <b>-v</b>:</dt><dd> Generate verbose output of mosaicing operations as they are done.</dd>
<dt> <b>-separate</b>:</dt><dd> 
Place each input file into a separate <i>stacked</i> band. 
</dd>
<dt> <b>-pct</b>:</dt><dd> 
Grab a pseudocolor table from the first input image, and use it for the output.
Merging pseudocolored images this way assumes that all input files use the same
color table.
</dd>
<dt> <b>-n</b> <i>nodata_value</i>:</dt><dd> 
Ignore pixels from files being merged in with this pixel value. 
</dd>
<dt> <b>-init</b> <i>value</i>:</dt><dd> 
Pre-initialize the output file with this value.  However, it is not marked
as the nodata value in the output file. 
</dd>
<dt> <b>-createonly</b>:</dt><dd> 
The output file is created (and potentially pre-initialized) but no input
image data is copied into it.  
</dd>
</dl>

NOTE: gdal_merge.py is a Python script, and will only work if GDAL was built
with Python support.

\if man
\section gauthor AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/

*******************************************************************************
/*! \page gdal2tiles gdal2tiles.py

generates directory with TMS tiles, KMLs and simple web viewers

\section gdal2tiles_synopsis SYNOPSIS

\verbatim
gdal2tiles.py [-title "Title"] [-publishurl http://yourserver/dir/]
              [-nogooglemaps] [-noopenlayers] [-nokml]
              [-googlemapskey KEY] [-forcekml] [-v]
              input_file [output_dir]
\endverbatim

\section gdal2tiles_description DESCRIPTION

This utility generates a directory with small tiles and metadata, following
OSGeo Tile Map Service Specification. Simple web pages with viewers based on
Google Maps and OpenLayers are generated as well - so anybody can comfortably
explore your maps on-line and you do not need to install or configure any
special software (like mapserver) and the map displays very fast in the
webbrowser. You only need to upload generated directory into a web server.

GDAL2Tiles creates also necessary metadata for Google Earth (KML
SuperOverlay), in case the supplied map uses EPSG:4326 projection.

World files and embedded georeference is used during tile generation, but you
can publish a picture without proper georeference too. 

<dl>
<dt> <b>-title</b> <i>"Title"</i>:</dt>
  <dd>Title used for generated metadata, web viewers and KML files.</dd>
<dt> <b>-publishurl</b> <i>http://yourserver/dir/</i>:</dt>
  <dd>Address of a directory into which you are going to upload the result. It should end with slash.</dd>
<dt> <b>-nogooglemaps</b>:</dt>
  <dd>Do not generate Google Maps based html page.</dd>
<dt> <b>-noopenlayers</b>:</dt>
  <dd>Do not generate OpenLayers based html page.</dd>
<dt> <b>-nokml</b>:</dt>
  <dd>Do not generate KML files for Google Earth.</dd>
<dt> <b>-googlemapskey</b> <i>KEY</i>:</dt>
  <dd>Key for your domain generated on Google Maps API web page (http://www.google.com/apis/maps/signup.html).</dd>
<dt> <b>-forcekml</b></dt>
  <dd>Force generating of KML files. Input file must use EPSG:4326 coordinates!</dd>
<dt> <b>-v</b></dt>
  <dd> Generate verbose output of tile generation.</dd>
</dl>


NOTE: gdal2tiles.py is a Python script, and will only work if GDAL was built
with Python support.

\if man
\section gdal2tiles_author AUTHORS
Klokan Petr Pridal <klokan@klokan.cz> as a Google SoC 2007 Project.
\endif
*/

*******************************************************************************
/*! \page gdal-config gdal-config

determines various information about a GDAL installation

\section csynopsis SYNOPSIS

\verbatim
gdal-config [OPTIONS]
Options:
        [--prefix[=DIR]]
        [--libs]
        [--cflags]
        [--version]
        [--ogr-enabled]
        [--formats]
\endverbatim

\section cdescription DESCRIPTION

This utility script (available on Unix systems) can be used to determine
various information about a GDAL installation.  It is normally just used
by configure scripts for applications using GDAL but can be queried by an
end user. 

<dl>
<dt> <b>--prefix</b>:</dt><dd> the top level directory for the GDAL
installation.</dd>
<dt> <b>--libs</b>:</dt><dd> The libraries and link directives required to
use GDAL.</dd>
<dt> <b>--cflags</b>:</dt><dd> The include and macro definition required to compiled
modules using GDAL.</dd>
<dt> <b>--version</b>:</dt><dd> Reports the GDAL version.</dd>
<dt> <b>--ogr-enabled</b>:</dt><dd> Reports "yes" or "no" to standard output depending
on whether OGR is built into GDAL.</dd>
<dt> <b>--formats</b>:</dt><dd> Reports which formats are configured into GDAL 
to stdout.  
</dd>
</dl>

*/

*******************************************************************************
/*! \page gdal_retile gdal_retile.py

gdal_retile - gdal_retily.py retiles a set of tiles and/or build tiled pyramid
levels

\section gdal_retile_synopsis SYNOPSIS

\verbatim

gdal_retile.py [-v] [-co NAME=VALUE]* [-of out_format] [-ps pixelWidth pixelHeight]
               [-ot  {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
                      CInt16/CInt32/CFloat32/CFloat64}]'
               [ -tileIndex tileIndexName [-tileIndexField tileIndexFieldName]]
               [-s_srs srs_def]  [-pyramidOnly]
               [-r {near/bilinear/cubic/cubicspline}]
               -levels numberoflevels
               -targetDir TileDirectory input_files

\endverbatim

\section gdal_retile_description DESCRIPTION

This utility will retile a set of input tile(s). All the input tile(s) must be
georeferenced in the same coordinate system and have a matching number of
bands. Optionally pyramid levels are generated. It  is  possible to generate
shape file(s) for the tiled output.

If your number of input tiles exhausts the command line buffer, use the
general --optfile option


<dl>
<dt> <b>-targetDir</b> <i>directory</i>:</dt><dd>
The Directory where the tile result is created. Pyramids are stored
in  subdirs  numbered  from  1. Created tile names have a numbering
schema and contain the name of the source tiles(s)
</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> 
Output format, defaults to GeoTIFF (GTiff). 
</dd>
<dt> <b>-co</b> <i>NAME=VALUE</i>:</dt><dd> 
Creation option for output file.  Multiple options can be specified.
</dd>
<dt> <b>-ot</b> <i>datatype</i>:</dt><dd> 
Force the output image bands to have a specific type. Use type names (ie. Byte, Int16,...)
</dd>
<dt> <b>-ps</b> <i>pixelsize_x pixelsize_y</i>:</dt><dd> Pixel size to be used
for the output file.  If not specified, 256 x 256 is the default
</dd>
<dt> <b>-levels</b> <i>numberOfLevels</i>:</dt><dd> 
Number of pyramids levels to build.
</dd>
<dt> <b>-v</b>:</dt><dd> 
Generate verbose output of tile operations as they are done.
</dd>
<dt> <b>-pyramidOnly</b>:</dt><dd> 
No retiling, build only the pyramids
</dd>
<dt> <b>-r</b> <i>algorithm</i>:</dt><dd> 
Resampling algorithm, default is near
</dd>
<dt> <b>-s_srs</b> <i>srs_def</i>:</dt><dd> Source spatial reference to use.
The coordinate systems  that  can  be passed  are  anything  supported by the
OGRSpatialReference.SetFro‐mUserInput()  call, which  includes  EPSG  PCS
and   GCSes   (ie.EPSG:4296),  PROJ.4  declarations (as above), or the name of
a .prf file containing well known text.
If  no  srs_def  is  given,  the srs_def  of the source tiles is used (if
there is any).
The srs_def will be propageted to created tiles (if possible) and  to  the
optional shape file(s).
</dd>
<dt> <b>-tileIndex</b> <i>tileIndexName</i>:</dt><dd> 
The name of shape file containing the result tile(s) index
</dd>
<dt> <b>-tileIndexField</b> <i>tileIndexFieldName</i>:</dt><dd> 
The name of the attribute containing the tile name
</dd>
</dl>

NOTE: gdal_merge.py is a Python script, and will only work if GDAL was built
with Python support.

\if man
\section gdal_retile_author AUTHORS
Christian Mueller <christian.mueller@nvoe.at>
\endif
*/

*******************************************************************************
/*! \page gdal_grid gdal_grid

creates regular grid from the scattered data

\section gdal_grid_synopsis SYNOPSIS

\verbatim
Usage: gdal_grid [--help-general] [--formats]
    [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
          CInt16/CInt32/CFloat32/CFloat64}]
    [-of format] [-co "NAME=VALUE"]
    [-a_srs srs_def]
    [-l layername]* [-where expression] [-sql select_statement]
    [-txe xmin xmax] [-tye ymin ymax] [-outsize xsize ysize]
    [-a algorithm[:parameter1=value1]*]    [-quiet]
    <src_datasource> <dst_filename>
\endverbatim

\section gdal_grid_description DESCRIPTION

This program creates regular grid (raster) from the scattered data read from
the OGR datasource. Input data will be interpolated to fill grid nodes with
values, you can choose from various interpolation methods. 

<dl>
<dt> <b>-ot</b> <i>type</i>:</dt><dd> For the output bands to be of the
indicated data type.</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> Select the output format.  The default
is GeoTIFF (GTiff).  Use the short format name.</dd>
<dt> <b>-txe</b> <em>xmin xmax</em>:</dt><dd> Set georeferenced
X extents of output file to be created.</dd>
<dt> <b>-tye</b> <em>ymin ymax</em>:</dt><dd> Set georeferenced
Y extents of output file to be created.</dd>
<dt> <b>-outsize</b> <i>xsize ysize</i>:</dt><dd> Set the size of the
output file in pixels and lines.</dd>
<dt> <b>-a_srs</b> <i>srs_def</i>:</dt><dd> Override the projection for the
output file.  The <i>srs_def</i> may be any of the usual GDAL/OGR forms,
complete WKT, PROJ.4, EPSG:n or a file containing the WKT. </dd>
<dt> <b>-a</b> <i>[algorithm[:parameter1=value1][:parameter2=value2]...]</i>:
</dt><dd> Set the interpolation algorithm name and (optionally) its parameters. See \ref gdal_grid_algorithms section for discussion of available options.</dd>
<dt> <b>-l</b> <em>layername</em>: </dt><dd> 
Indicates the layer(s) from the datasource that will be used for input 
features.  May be specified multiple times, but at least one layer name or a -sql option must be specified.</dd>
<dt> <b>-where</b> <em>expression</em>: </dt><dd> 
An optional SQL WHERE style query expression to be applied to select features 
to burn in from the input layer(s). </dd>
<dt> <b>-sql</b> <em>select_statement</em>: </dt><dd> 
An SQL statement to be evaluated against the datasource to produce a
virtual layer of features to be burned in.</dd>
<dt> <b>-co</b> <i>"NAME=VALUE"</i>:</dt><dd> Passes a creation option to the
output format driver.  Multiple <b>-co</b> options may be listed.  See format 
specific documentation for legal creation options for each format.</dd>
<dt> <b>-quiet</b>:</dt><dd> Suppress progress monitor and other non-error
output.</dd>
<dt> <em>src_datasource</em>: </dt><dd> 
Any OGR supported readable datasource.</dd>
<dt> <em>dst_filename</em>: </dt><dd> 
The GDAL supported output file.</dd>

</dl>

\section gdal_grid_algorithms INTERPOLATION ALGORITHMS

There are number of interpolation algorithms to choose from.

<dl>
<dt><i>invdist</i>:</dt> <dd>Inverse distance to a power. This is default
algorithm. It has following parameters:</dd>

<dl>
<dt><i>power</i>:</dt> <dd>Weighting power (default 2.0).</dd>
<dt><i>smoothing</i>:</dt> <dd>Smoothing parameter (default 0.0).</dd>
<dt><i>radius1</i>:</dt> <dd>The first radius (X axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>radius2</i>:</dt> <dd>The second radius (Y axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>angle</i>:</dt> <dd>Angle of search ellipse rotation in degrees
(counter clockwise, default 0.0).</dd>
<dt><i>max_points</i>:</dt> <dd>Maximum number of data points to use. Do not
search for more points than this number. This is only used if search ellipse
is set (both radiuses are non-zero). Zero means that all found points should
be used. Default is 0.</dd>
<dt><i>min_points</i>:</dt> <dd>Minimum number of data points to use. If less
amount of points found the grid node considered empty and will be filled with
NODATA marker. This is only used if search ellipse is set (both radiuses are
non-zero). Default is 0.</dd>
<dt><i>nodata</i>:</dt> <dd>NODATA marker to fill empty points (default
0.0).</dd>
</dl>

<dt><i>average</i>:</dt> <dd>Moving average algorithm. It has following
parameters:</dd>

<dl>
<dt><i>radius1</i>:</dt> <dd>The first radius (X axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>radius2</i>:</dt> <dd>The second radius (Y axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>angle</i>:</dt> <dd>Angle of search ellipse rotation in degrees
(counter clockwise, default 0.0).</dd>
<dt><i>min_points</i>:</dt> <dd>Minimum number of data points to use. If less
amount of points found the grid node considered empty and will be filled with
NODATA marker. Default is 0.</dd>
<dt><i>nodata</i>:</dt> <dd>NODATA marker to fill empty points (default
0.0).</dd>
</dl>

Note, that it is essential to set search ellipse for moving average method. It
is a window that will be averaged when computing grid nodes values.

<dt><i>nearest</i>:</dt> <dd>Moving average algorithm. It has following
parameters:</dd>

<dl>
<dt><i>radius1</i>:</dt> <dd>The first radius (X axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>radius2</i>:</dt> <dd>The second radius (Y axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>angle</i>:</dt> <dd>Angle of search ellipse rotation in degrees
(counter clockwise, default 0.0).</dd>
<dt><i>nodata</i>:</dt> <dd>NODATA marker to fill empty points (default
0.0).</dd>
</dl>

</dl>

\section gdal_grid_csv READING COMMA SEPARATED VALUES

Often you have a text file with a list of comma separated XYZ values to work
with (so called CSV file). You can easily use that kind of data source in \ref
gdal_grid. All you need is create a virtual dataset header (VRT) for you CSV
file and use it as input datasource for \ref gdal_grid. You can find details
on VRT format at <a href="ogr/drv_vrt.html">Virtual Format</a> description
page.

Here is a small example. Let we have a CSV file called <i>dem.csv</i>
containing

\verbatim
Easting,Northing,Elevation
86943.4,891957,139.13
87124.3,892075,135.01
86962.4,892321,182.04
87077.6,891995,135.01
...
\endverbatim

For above data we will create <i>dem.vrt</i> header with the following
content:

\verbatim
<OGRVRTDataSource>
    <OGRVRTLayer name="dem">
        <SrcDataSource>dem.csv</SrcDataSource> 
	<GeometryType>wkbPoint</GeometryType> 
	<GeometryField encoding="PointFromColumns" x="Easting" y="Northing" z="Elevation"/> 
    </OGRVRTLayer>
</OGRVRTDataSource>
\endverbatim

Now you can use <i>dem.vrt</i> with all OGR programs (start with \ref ogrinfo
to test that everything works fine). The datasource will contain single layer
called <i>"dem"</i> filled with point features constructed from values in CSV
file. Using this technique you can handle CSV files with more than three
columns, switch columns, etc.

If your CSV file does not contain column headers then it can be handled in the
following way:

\verbatim
<GeometryField encoding="PointFromColumns" x="field_1" y="field_2" z="field_3"/>
\endverbatim

<a href="ogr/drv_csv.html">Comma Separated Value</a> description page contains
details on CSV format supported by GDAL/OGR.

\section gdal_grid_example EXAMPLE

The following would create raster TIFF file from VRT datasource described in
\ref gdal_grid_csv section using the inverse distance to a power method.

\verbatim
gdal_grid -a invdist:power=2.0:smoothing=1.0 -txe 85000 89000 -tye 894000 890000 -outsize 400 400 -of GTiffG -ot Float64 -l dem dem.vrt dem.tiff
\endverbatim

\if man
\section gdal_grid_author AUTHORS
Andrey Kiselev <dron@ak4719.spb.edu>
\endif
*/

