GDAL_CONTOUR(1)
π NAME π
gdal_contour β okay bestie, this one builds vector contour lines from a raster elevation model. It's the GDAL_CONTOUR(1) page, and it's lowkey iconic for turning your DEM into contour realness π
β¨
β¨ SYNOPSIS β¨
gdal_contour [-b <band>] [-a <attribute_name>] [-amin <attribute_name>] [-amax <attribute_name>]
[-3d] [-inodata]
[-snodata n] [-i <interval>]
[-f <formatname>] [[-dsco NAME=VALUE] ...] [[-lco NAME=VALUE] ...]
[-off <offset>] [-fl <level> <level>...] [-e <exp_base>]
[-nln <outlayername>] [-q] [-p]
<src_filename> <dst_filename>
π¦ DESCRIPTION π¦
Okay so the gdal_contour generates a vector contour file from the input raster elevation model (DEM). Main character energy for elevation data, fr fr.
The contour line-strings are oriented consistently, and the high side will be on the right β i.e. a line string goes clockwise around a top. Slay, consistent orientation β
Now the options, every single one, no skipping:
-b <band>β picks a particular band to get the DEM from. Defaults to band 1. Choose your band, bestie π-a <name>β provides a name for the attribute in which to put the elevation. If not provided no elevation attribute is attached. Ignored in polygonal contouring (-p) mode.-amin <name>β provides a name for the attribute in which to put the minimum elevation of contour polygon. If not provided no minimum elevation attribute is attached. Ignored in default line contouring mode. New in version 2.4.0.-amax <name>β provides a name for the attribute in which to put the maximum elevation of contour polygon. If not provided no maximum elevation attribute is attached. Ignored in default line contouring mode. New in version 2.4.0.-3dβ force production of 3D vectors instead of 2D. Includes elevation at every vertex. We love a little dimension π-inodataβ ignore any nodata value implied in the dataset β treat all values as valid. No cap, everything counts π«Ά-snodata <value>β input pixel value to treat as"nodata".-f <format>β create output in a particular format. New in version 2.3.0: if not specified, the format is guessed from the extension (previously was ESRI Shapefile).-dsco <NAME=VALUE>β dataset creation option (format specific).-lco <NAME=VALUE>β layer creation option (format specific).-i <interval>β elevation interval between contours.-off <offset>β offset from zero relative to which to interpret intervals.-fl <level>β name one or more"fixed levels"to extract.-e <base>β generate levels on an exponential scale:base ^ k, forkan integer. New in version 2.4.0.-nln <name>β provide a name for the output vector layer. Defaults to"contour".-pβ generate contour polygons rather than contour lines. New in version 2.4.0.-qβ be quiet. Shhh, it's giving stealth mode π€«
πΈ C API πΈ
Functionality of this utility can be done from C with GDALContourGenerate(). C girlies, this one's for you π«Ά
π EXAMPLE π
This would create 10-meter 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.
gdal_contour -a elev dem.tif contour.shp -i 10.0
π AUTHOR π
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de> β iconic authors, no cap π
π COPYRIGHT π
1998-2026 β that's the copyright range, bestie π
Final vibe check: source/version is GDAL, the page is GDAL_CONTOUR(1), and the date is Jan 08, 2026. Mwah πβ¨
π¦ where this page comes from
- epel 9: gdal3.4 3.4.3-5.el9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms