View on GitHub

QGIS Visibility Analysis

Quantum GIS plugin for visibility analysis

go to main page

Installation:

The plugin is installed as any other from the official QGIS repository (In QGIS go to Plugins -> Manage and install … ). Be sure to enable experimental versions if you’re looking for the latest version.

In case the usual install doesn’t work, the plugin can be installed manually:
First you need to locate your QGIS plugins folder. On Windows it would be ‘C:\users\username\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins’ (do a file search for ‘QGIS3’ …)

Plugin code can then be extracted in a new folder inside the plugins folder (you should name the folder ViewshedAnalysis). Take care that the code is not inside a subfolder - the folder structure should be like this:

Workflow

Visibility analysis is broken down in two steps: first a set of observer points is created using Create observer points module, which are then fed to other modules.

Input data

[I repeat: do not use unprojected data in degrees (Lat/lon, WGS 84), such data is inappropriate for precision calculation. Be sure to understand GIS projections before mailing me…]

Modules

Create observer points

This is the first step for the visibility analysis. The observer points in the input will be processed and written as a geopackage file with standardised field names. Data will be reprojected to match the elevation model used, if needed. Data inside the table can be changed manually - but the names and data types of fields should remain unchanged.

Parameters

Mandatory parameters can be set as fixed values, while all parameters may be read from table fields. The latter method is prone to errors : in case of a problem (e.g. an empty field) the fixed value specified in the text box will be applied, or a default value. If in doubt, check the generated file and Log Messages (Viewshed info).

mask

Five additional parameters can be used to mask out specific areas.

Viewshed

This module performs a visibility calcualtion for individual points over a terrain model (in a raster grid format). Three output types are available:

When multiple observer points are used, individual viewsheds will be combined into a cumulative viewshed model representing the number of positive results for each data point.

Parameters

Intervisibility network

The output of the intervisibility network routine is a network, in vector format, of visual relationships between two sets of points (or within a single set). For each link the depth below/above visible horizon is calculated, as in many cases only a portion of the specified target is visible.

Parameters

Visibility index (total viewshed)

This module calculates the visual exposition of each data point - a pixel - for a given terrain model. The Index is calculated as the proportion of positive views, returning 1.0 when all views are positive. Note that this is a very complex calculation which may take up to a couple of hours for moderately large datasets. In order to reduce execution time, only a sample of lines of sight is taken into account (between 8 and 64).

Parameters

Other parameters are the same as for other modules. For further detail, check https://landscapearchaeology.org/2020/visibility-index/

Earth curvature and refraction

Similar to other viewshed algorithms available, it is possible to account for effects of the Earth’s curvature and refraction of the light when travelling through the atmosphere. The latter effect is due to differences in density and in composition between layers of the atmosphere, as for instance between air and water. These parameters are insignificant over smaller distances, especially for coarse grained terrain models.

Following formula is used to adjust height values in the DEM:

z adjusted = z - (Dist² / Diam Earth ) * (1 - Refraction)

Where:
Dist: The planimetric distance between the observation point and the target point.
Refraction: The refractivity coefficient of light (normally it has the opposite, but smaller, effect than the curvature).
Diam: The diameter of the Earth that is estimated as Equatorial radius + Polar radius. These values are taken from the projection system assigned to the Raster by QGIS. In case of error or unrealistic values, the default radius of 6378.137 kilometers and flattening of 298.257 are used.

For more explanation see ArcGIS web page

General settings

These are accessed under Processing Options (search for Providers » Visibility Analysis)

Dependencies

The plugin is coded in Python 3.6 and does not require any additional libraries than those provided by standard QGIS installation. These libraries include numpy and gdal for manipulating raster data, and PyQt5 and QGIS core libraries for integration with QGIS.

Repository and download

https://github.com/zoran-cuckovic/QGIS-visibility-analysis

Tutorials

See main page.