Calculates viewshed using method defined in [Wang2000] for a user defined point.


gdal_viewshed [-b <band>] [-inodata]
              [-snodata n] [-f <formatname>]
              [-oz <observer_height>] [-tz <target_height>] [-md <max_distance>]
              [-ox <observer_x>] [-oy <observer_y>]
              [-vv <visibility>] [-iv <invisibility>]
              [-ov <out_of_range>] [-cc <curvature_coef>]
              [[-co NAME=VALUE] ...]
              <src_filename> <dst_filename>


The gdal_viewshed generates a 0-1 visibility raster band from the input raster elevation model (DEM).

New in version 3.1.0.


Many formats have one or more optional creation options that can be used to control particulars about the file created. For instance, the GeoTIFF driver supports creation options to control compression, and whether the file should be tiled.

The creation options available vary by format driver, and some simple formats have no creation options at all. A list of options supported for a format can be listed with the –formats command line option but the documentation for the format is the definitive source of information on driver creation options. See Raster drivers format specific documentation for legal creation options for each format.

-b <band>

Select an input band band for output. Bands are numbered from 1. Only a single band can be used.

-a_nodata <value>

Assign a specified nodata value to output band.

-ox <value>

Observer X (in SRS units).

-oy <value>

Observer Y (in SRS units).

-oz <value>

Observer height.

-tz <value>

Target height.

-md <value>

Maximum distance from observer to compute visibiliy.

-cc <value>

Curvature coefficient as described in [Wang2000]. Default: 0

-iv <value>

Pixel value to set for invisibility. Default: -1

-ov <value>

Pixel value to set for out-of-range. Default: 0

-vv <value>

Pixel value to set for visibilty. Default: 255


Functionality of this utility can be done from C with GDALViewshedGenerate().


Compute the visibility of an elevation raster data source with defaults


A computed visibility for two separate -ox and -oy points on a DEM.

gdal_viewshed -md 500 -x "-10147017".0 -y "5108065" source.tif destination.tif

Generating Viewsheds without Using Sightlines. Wang, Jianjun, Robinson, Gary J., and White, Kevin. Photogrammetric Engineering and Remote Sensing. p81.