Skip to content

Commit b160c21

Browse files
committed
DOC: clarify interaction of -inodata and -snodata in gdal_contour
1 parent e878b5b commit b160c21

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

doc/source/programs/gdal_contour.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,19 @@ be on the right, i.e. a line string goes clockwise around a top.
6969

7070
.. option:: -inodata
7171

72-
Ignore any nodata value implied in the dataset - treat all values as valid.
72+
Ignore any NoData value defined on the input dataset and treat all input
73+
pixel values as valid.
7374

7475
.. option:: -snodata <value>
7576

76-
Input pixel value to treat as "nodata".
77+
Treat the specified input pixel value as NoData and ignore it when generating
78+
contours.
79+
80+
81+
If both :option:`-inodata` and :option:`-snodata` are specified,
82+
:option:`-snodata` takes precedence for explicitly defining which input
83+
pixel values are ignored.
84+
7785

7886
.. option:: -f <format>
7987

@@ -148,6 +156,18 @@ Functionality of this utility can be done from C with :cpp:func:`GDALContourGene
148156
Examples
149157
--------
150158

159+
.. example::
160+
161+
:title: Ignoring NoData values when generating contours
162+
163+
.. code-block:: bash
164+
165+
# Ignore the dataset's implicit NoData value
166+
gdal_contour -inodata dem.tif contours.shp
167+
168+
# Ignore pixels with value 0, regardless of dataset NoData metadata
169+
gdal_contour -snodata 0 dem.tif contours.shp
170+
151171
.. example::
152172

153173
:title: Creating contours from a DEM
@@ -215,7 +235,7 @@ Examples
215235
and produce a GeoJSON output with the contour min and max elevations in the ``min`` and ``max`` attributes.
216236
217237
218-
If the minimum and maximum values from the raster are desired, the special values `MIN`` and `MAX``
238+
If the minimum and maximum values from the raster are desired, the special values ``MIN`` and ``MAX``
219239
(case insensitive) can be used:
220240
221241
.. code-block:: bash

0 commit comments

Comments
 (0)