1gdal_utilities(1) General Commands Manual gdal_utilities(1)
2
3
4
6 gdal_utilities - GDAL Utilities The following utility programs are
7 distributed with GDAL.
8
9 · gdalinfo - report information about a file.
10 · gdal_translate - Copy a raster file, with control of output format.
11 · gdaladdo - Add overviews to a file.
12 · gdalwarp - Warp an image into a new coordinate system.
13 · gdaltindex - Build a MapServer raster tileindex.
14 · gdal_contour - Contours from DEM.
15 · rgb2pct.py - Convert a 24bit RGB image to 8bit paletted.
16 · pct2rgb.py - Convert an 8bit paletted image to 24bit RGB.
17 · gdal_merge.py - Build a quick mosaic from a set of images.
18 · gdal_rasterize - Rasterize vectors into raster file.
19 · gdal-config - Get options required to build software using GDAL.
21 Access an existing file to read it is generally quite simple. Just
22 indicate the name of the file or dataset on the commandline. However,
23 creating a file is more complicated. It may be necessary to indicate
24 the the format to create, various creation options affecting how it
25 will be created and perhaps a coordinate system to be assigned. Many of
26 these options are handled similarly by different GDAL utilities, and
27 are introduced here.
28 -of format
29 Select the format to create the new file as. The formats are
30 assigned short names such as GTiff (for GeoTIFF) or HFA (for Erdas
31 Imagine). The list of all format codes can be listed with the
32 --formats switch. Only formats list as '(rw)' (read-write) can be
33 written.
34 Many utilities default to creating GeoTIFF files if a format is not
35 specified. File extensions are not used to guess output format, nor are
36 extensions generally added by GDAL if not indicated in the filename by
37 the user.
38 -co NAME=VALUE
39 Many formats have one or more optional creation options that can be
40 used to control particulars about the file created. For instance,
41 the GeoTIFF driver supports creation options to control
42 compression, and whether the file should be tiled.
43 The creation options available vary by format driver, and some simple
44 formats have no creation options at all. A list of options supported
45 for a format can be listed with the '--format <format>' commandline
46 option but the web page for the format is the definitive source of
47 information on driver creation options.
48 -a_srs SRS
49 Several utilities, (gdal_translate and gdalwarp) include the
50 ability to specify coordinate systems with commandline options like
51 -a_srs (assign SRS to output), -s_srs (source SRS) and -t_srs
52 (target SRS).
53 These utilities allow the coordinate system (SRS = spatial reference
54 system) to be assigned in a variety of formats.
55 · NAD27/NAD83/WGS84/WGS72: These common geographic (lat/long)
56 coordinate systems can be used directly by these names.
57 · EPSG:n: Coordinate systems (projected or geographic) can be selected
58 based on their EPSG codes, for instance EPSG:27700 is the British
59 National Grid. A list of EPSG coordinate systems can be found in the
60 GDAL data files gcs.csv and pcs.csv.
61 · PROJ.4 Definitions: A PROJ.4 definition string can be used as a
62 coordinate system. For instance '+proj=utm +zone=11 +datum=WGS84'.
63 Take care to keep the proj.4 string together as a single argument to
64 the command (usually by double quoting).
65 · OpenGIS Well Known Text: The Open GIS Consortium has defined a
66 textual format for describing coordinate systems as part of the
67 Simple Features specifications. This format is the internal working
68 format for coordinate systems used in GDAL. The name of a file
69 containing a WKT coordinate system definition may be used a
70 coordinate system argument, or the entire coordinate system itself
71 may be used as a commandline option (though escaping all the quotes
72 in WKT is quite challenging).
73 · ESRI Well Known Text: ESRI uses a slight variation on OGC WKT format
74 in their ArcGIS product (ArcGIS .prj files), and these may be used in
75 a similar manner to WKT files, but the filename should be prefixed
76 with ESRI::. For example 'ESRI::NAD 1927 StatePlane Wyoming West FIPS
77 4904.prj'.
79 All GDAL command line utility programs support the following 'general'
80 options.
81 --version
82 Report the version of GDAL and exit.
83 --formats
84 List all raster formats supported by this GDAL build (read-only and
85 read-write) and exit. The format support is indicated as follows:
86 'ro' is read-only driver; 'rw' is read or write (ie. supports
87 CreateCopy); 'rw+' is read, write and update (ie. supports Create).
88 --format format
89 List detailed information about a single format driver. The format
90 should be the short name reported in the --formats list, such as
91 GTiff.
92 --optfile file
93 Read the named file and substitute the contents into the
94 commandline options list. Lines beginning with # will be ignored.
95 Multi-word arguments may be kept together with double quotes.
96 --config key value
97 Sets the named configuration keyword to the given value, as opposed
98 to setting them as environment variables. Some common configuration
99 keywords are GDAL_CACHEMAX (memory used internally for caching in
100 megabytes) and GDAL_DATA (path of the GDAL 'data' directory).
101 Individual drivers may be influenced by other configuration
102 options.
103 --debug value
104 Control what debugging messages are emitted. A value of ON will
105 enable all debug messages. A value of OFF will disable all debug
106 messages. Another value will select only debug messages containing
107 that string in the debug prefix code.
108 --help-general
109 Gives a brief usage message for the generic GDAL commandline
110 options and exit.
111GDAL 31 Jul 2007 gdal_utilities(1)