Forrest logo
back to the gdal_contour tool

gdal_contour:tldr:0ac3c

gdal_contour: Create a vector dataset with contour lines spread over an 100-meter [i]nterval while [a]ttributing the elevation property as "ele".
$ gdal_contour -a ${ele} -i ${100-0} ${path-to-input-tif} ${path-to-output-gpkg}
try on your machine

The command "gdal_contour" is a command-line tool from the GDAL (Geospatial Data Abstraction Library) package that is used to generate contour lines from a raster dataset.

Specifically, in the given command:

  • "-a ${ele}" specifies the name of the attribute to be assigned to the contour lines. In this case, the attribute name is "ele". This means that each contour line generated will have an elevation value associated with it.

  • "-i ${100-0}" indicates the contour interval or the difference in elevation between adjacent contour lines. In this case, the interval is set from 100 to 0, meaning that contour lines will be generated at intervals of 100.

  • "${path-to-input-tif}" represents the path to the input raster file (in TIF format) from which contour lines will be generated. You need to replace "${path-to-input-tif}" with the actual path to your input raster file.

  • "${path-to-output-gpkg}" refers to the path where the generated contour lines will be saved in a GeoPackage file format. You need to replace "${path-to-output-gpkg}" with the desired output file path and name.

In summary, this command will generate contour lines from a raster file, using the attribute name "ele" for elevation values and a contour interval of 100, and save the generated contour lines in a GeoPackage file.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gdal_contour tool