EnglishFrenchSpanish

Ad


OnWorks favicon

gdal_translate - Online in the Cloud

Run gdal_translate in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command gdal_translate that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


gdal_translate - gdal_translate converts raster data between different formats

SYNOPSIS


gdal_translate [--help-general]
[-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}] [-strict]
[-of format] [-b band] [-mask band] [-expand {gray|rgb|rgba}]
[-outsize xsize[%] ysize[%]]
[-unscale] [-scale[_bn] [src_min src_max [dst_min dst_max]]]* [-exponent[_bn] exp_val]*
[-srcwin xoff yoff xsize ysize] [-projwin ulx uly lrx lry] [-epo] [-eco]
[-a_srs srs_def] [-a_ullr ulx uly lrx lry] [-a_nodata value]
[-gcp pixel line easting northing [elevation]]*
[-mo "META-TAG=VALUE"]* [-q] [-sds]
[-co "NAME=VALUE"]* [-stats] [-norat]
src_dataset dst_dataset

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.

-ot: type
For the output bands to be of the indicated data type.

-strict:
Don't be forgiving of mismatches and lost data when translating to the output format.

-of format:
Select the output format. The default is GeoTIFF (GTiff). Use the short format name.

-b band:
Select an input band band for output. Bands are numbered from 1. Multiple -b switches
may be used to select a set of input bands to write to the output file, or to reorder
bands. Starting with GDAL 1.8.0, band can also be set to 'mask,1' (or just 'mask') to
mean the mask band of the first band of the input dataset.

-mask band:
(GDAL >= 1.8.0) Select an input band band to create output dataset mask band. Bands
are numbered from 1. band can be set to 'none' to avoid copying the global mask of the
input dataset if it exists. Otherwise it is copied by default ('auto'), unless the
mask is an alpha channel, or if it is explicitly used to be a regular band of the
output dataset ('-b mask'). band can also be set to 'mask,1' (or just 'mask') to mean
the mask band of the 1st band of the input dataset.

-expand gray|rgb|rgba:
(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. Useful for output drivers such as JPEG, JPEG2000, MrSID,
ECW that don't support color indexed datasets. The 'gray' value (from GDAL 1.7.0)
enables to expand a dataset with a color table that only contains gray levels to a
gray indexed dataset.

-outsize xsize[%] ysize[%]:
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.

-scale [src_min src_max [dst_min dst_max]]:
Rescale the input pixels values from the range src_min to src_max to the range dst_min
to dst_max. If omitted the output range is 0 to 255. If omitted the input range is
automatically computed from the source data. Before GDAL 1.11, it can be specified
only once, and in that case, it applies to all bands of the output dataset. Starting
with GDAL 1.11, -scale can be repeated several times (if specified only once, it also
applies to all bands of the output dataset), so as to specify per band parameters. It
is also possible to use the '-scale_bn' syntax where bn is a band number (e.g.
'-scale_2' for the 2nd band of the output dataset) to specify the parameters of one or
several specific bands.

-exponent exp_val:
(From GDAL 1.11) To apply non-linear scaling with a power function. exp_val is the
exponent of the power function (must be postive). This option must be used with the
-scale option. If specified only once, -exponent applies to all bands of the output
image. It can be repeated several times so as to specify per band parameters. It is
also possible to use the '-exponent_bn' syntax where bn is a band number (e.g.
'-exponent_2' for the 2nd band of the output dataset) to specify the parameters of one
or several specific bands.

-unscale:
Apply the scale/offset metadata for the bands to convert scaled values to unscaled
values. It is also often necessary to reset the output datatype with the -ot switch.

-srcwin xoff yoff xsize ysize:
Selects a subwindow from the source image for copying based on pixel/line location.

-projwin ulx uly lrx lry:
Selects a subwindow from the source image for copying (like -srcwin) but with the
corners given in georeferenced coordinates.

-epo: (Error when Partially Outside)
(GDAL >= 1.10) If this option is set, -srcwin or -projwin values that falls partially
outside the source raster extent will be considered as an error. The default behaviour
starting with GDAL 1.10 is to accept such requests, when they were considered as an
error before.

-eco: (Error when Completely Outside)
(GDAL >= 1.10) Same as -epo, except that the criterion for erroring out is when the
request falls completely outside the source raster extent.

-a_srs srs_def:
Override the projection for the output file. The srs_def may be any of the usual
GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n or a file containing the WKT.

-a_ullr ulx uly lrx lry:
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.

-a_nodata value:
Assign a specified nodata value to output bands. Starting with GDAL 1.8.0, can be set
to none to avoid setting a nodata value to the output file if one exists for the
source file

-mo 'META-TAG=VALUE':
Passes a metadata key and value to set on the output dataset if possible.

-co 'NAME=VALUE':
Passes a creation option to the output format driver. Multiple -co options may be
listed. See format specific documentation for legal creation options for each format.

-gcp pixel line easting northing elevation:
Add the indicated ground control point to the output dataset. This option may be
provided multiple times to provide a set of GCPs.

-q:
Suppress progress monitor and other non-error output.

-sds:
Copy all subdatasets of this file to individual output files. Use with formats like
HDF or OGDI that have subdatasets. The output file naming scheme has changed in GDAL
1.11 (e.g. ofile_1.tif, ofile_2.tif).

-stats:
(GDAL >= 1.8.0) Force (re)computation of statistics.

-norat
(GDAL >= 1.11) Do not copy source RAT into destination dataset.

src_dataset:
The source dataset name. It can be either file name, URL of data source or subdataset
name for multi-dataset files.

dst_dataset:
The destination file name.

EXAMPLE


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

Starting with GDAL 1.8.0, to create a JPEG-compressed TIFF with internal mask from a RGBA
dataset :

gdal_translate rgba.tif withmask.tif -b 1 -b 2 -b 3 -mask 4 -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR --config GDAL_TIFF_INTERNAL_MASK YES

Starting with GDAL 1.8.0, to create a RGBA dataset from a RGB dataset with a mask :

gdal_translate withmask.tif rgba.tif -b 1 -b 2 -b 3 -b mask

AUTHORS


Frank Warmerdam [email protected], Silke Reimer [email protected]

Use gdal_translate online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Firebird
    Firebird
    Firebird RDBMS offers ANSI SQL features
    & runs on Linux, Windows &
    several Unix platforms. Features
    excellent concurrency & performance
    & power...
    Download Firebird
  • 2
    KompoZer
    KompoZer
    KompoZer is a wysiwyg HTML editor using
    the Mozilla Composer codebase. As
    Nvu's development has been stopped
    in 2005, KompoZer fixes many bugs and
    adds a f...
    Download KompoZer
  • 3
    Free Manga Downloader
    Free Manga Downloader
    The Free Manga Downloader (FMD) is an
    open source application written in
    Object-Pascal for managing and
    downloading manga from various websites.
    This is a mirr...
    Download Free Manga Downloader
  • 4
    UNetbootin
    UNetbootin
    UNetbootin allows you to create bootable
    Live USB drives for Ubuntu, Fedora, and
    other Linux distributions without
    burning a CD. It runs on Windows, Linux,
    and ...
    Download UNetbootin
  • 5
    Dolibarr ERP - CRM
    Dolibarr ERP - CRM
    Dolibarr ERP - CRM is an easy to use
    ERP and CRM open source software package
    (run with a web php server or as
    standalone software) for businesses,
    foundations...
    Download Dolibarr ERP - CRM
  • 6
    SQuirreL SQL Client
    SQuirreL SQL Client
    SQuirreL SQL Client is a graphical SQL
    client written in Java that will allow
    you to view the structure of a JDBC
    compliant database, browse the data in
    tables...
    Download SQuirreL SQL Client
  • More »

Linux commands

Ad