<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>GDAL: gdal_translate</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.2-20100208 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li class="current"><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> </div> <div class="contents"> <h1><a class="anchor" id="gdal_translate">gdal_translate </a></h1><p>converts raster data between different formats</p> <h2><a class="anchor" id="tsynopsis"> SYNOPSIS</a></h2> <div class="fragment"><pre class="fragment"> gdal_translate [--help-general] [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/ CInt16/CInt32/CFloat32/CFloat64}] [-strict] [-of format] [-b band] [-expand {rgb|rgba}] [-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 </pre></div><h2><a class="anchor" id="tdescription"> DESCRIPTION</a></h2> <p>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.</p> <dl> <dt><b>-ot</b>: <em>type</em></dt> <dd>For the output bands to be of the indicated data type. </dd> <dt><b>-strict</b>:</dt> <dd>Do'nt be forgiving of mismatches and lost data when translating to the output format. </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>-b</b> <em>band</em>:</dt> <dd>Select an input band <em>band</em> 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>-expand</b> <em>rgb|rgba</em>:</dt> <dd>(From GDAL 1.6.0) To expose a dataset with 1 band with a color table as a dataset with 3 (RGB) or 4 (RGBA) bands. Usefull for output drivers such as JPEG, JPEG2000, MrSID, ECW that don't support color indexed datasets. </dd> <dt><b>-outsize</b> <em>xsize[%] ysize[%]</em>:</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> <em>[src_min src_max [dst_min dst_max]]</em>:</dt> <dd>Rescale the input pixels values from the range <em>src_min</em> to <em>src_max</em> to the range <em>dst_min</em> to <em>dst_max</em>. 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> <em>xoff yoff xsize ysize</em>:</dt> <dd>Selects a subwindow from the source image for copying based on pixel/line location. </dd> <dt><b>-projwin</b> <em>ulx uly lrx lry</em>:</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> <em>srs_def</em>:</dt> <dd>Override the projection for the output file. The <em>srs_def</em> 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> <em>ulx uly lrx lry</em>:</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> <em>value</em>:</dt> <dd>Assign a specified nodata value to output bands. </dd> <dt><b>-mo</b> <em>"META-TAG=VALUE"</em>:</dt> <dd>Passes a metadata key and value to set on the output dataset if possible. </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><b>-gcp</b> <em>pixel line easting northing</em>:</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><em>src_dataset</em>:</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><em>dst_dataset</em>:</dt> <dd>The destination file name. </dd> </dl> <h2><a class="anchor" id="texample"> EXAMPLE</a></h2> <div class="fragment"><pre class="fragment"> gdal_translate -of GTiff -co "TILED=YES" utm.tif utm_tiled.tif </pre></div> </div> <hr> Generated for GDAL by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.6.2-20100208. </body> </html>