1GDAL_CONTOUR(1) GDAL GDAL_CONTOUR(1)
2
3
4
6 gdal_contour - Builds vector contour lines from a raster elevation
7 model.
8
10 gdal_contour [-b <band>] [-a <attribute_name>] [-amin <attribute_name>] [-amax <attribute_name>]
11 [-3d] [-inodata]
12 [-snodata n] [-i <interval>]
13 [-f <formatname>] [[-dsco NAME=VALUE] ...] [[-lco NAME=VALUE] ...]
14 [-off <offset>] [-fl <level> <level>...] [-e <exp_base>]
15 [-nln <outlayername>] [-q] [-p]
16 <src_filename> <dst_filename>
17
19 The gdal_contour generates a vector contour file from the input raster
20 elevation model (DEM).
21
22 The contour line-strings are oriented consistently and the high side
23 will be on the right, i.e. a line string goes clockwise around a top.
24
25 -b <band>
26 Picks a particular band to get the DEM from. Defaults to band 1.
27
28 -a <name>
29 Provides a name for the attribute in which to put the elevation.
30 If not provided no elevation attribute is attached. Ignored in
31 polygonal contouring (-p) mode.
32
33 -amin <name>
34 Provides a name for the attribute in which to put the minimum
35 elevation of contour polygon. If not provided no minimum eleva‐
36 tion attribute is attached. Ignored in default line contouring
37 mode.
38
39 New in version 2.4.0.
40
41
42 -amax <name>
43 Provides a name for the attribute in which to put the maximum
44 elevation of contour polygon. If not provided no maximum eleva‐
45 tion attribute is attached. Ignored in default line contouring
46 mode.
47
48 New in version 2.4.0.
49
50
51 -3d Force production of 3D vectors instead of 2D. Includes eleva‐
52 tion at every vertex.
53
54 -inodata
55 Ignore any nodata value implied in the dataset - treat all val‐
56 ues as valid.
57
58 -snodata <value>
59 Input pixel value to treat as "nodata".
60
61 -f <format>
62 Create output in a particular format.
63
64 New in version 2.3.0: If not specified, the format is guessed
65 from the extension (previously was ESRI Shapefile).
66
67
68 -dsco <NAME=VALUE>
69 Dataset creation option (format specific)
70
71 -lco <NAME=VALUE>
72 Layer creation option (format specific)
73
74 -i <interval>
75 Elevation interval between contours.
76
77 -off <offset>
78 Offset from zero relative to which to interpret intervals.
79
80 -fl <level>
81 Name one or more "fixed levels" to extract.
82
83 -e <base>
84 Generate levels on an exponential scale: base ^ k, for k an in‐
85 teger.
86
87 New in version 2.4.0.
88
89
90 -nln <name>
91 Provide a name for the output vector layer. Defaults to "con‐
92 tour".
93
94 -p Generate contour polygons rather than contour lines.
95
96 New in version 2.4.0.
97
98
99 -q Be quiet.
100
102 Functionality of this utility can be done from C with GDALContourGener‐
103 ate().
104
106 This would create 10-meter contours from the DEM data in dem.tif and
107 produce a shapefile in contour.shp|shx|dbf with the contour elevations
108 in the elev attribute.
109
110 gdal_contour -a elev dem.tif contour.shp -i 10.0
111
113 Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@inteva‐
114 tion.de>
115
117 1998-2022
118
119
120
121
122 May 04, 2022 GDAL_CONTOUR(1)