View on GitHub

QGIS Visibility Analysys

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 result will be written as a geopackage file with standardised field names and 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

All parameters (observer/target height, point ID, radius of analysis) are read from the associated data table for each view-point. In case of error (eg. an empty field) the fixed value specified in the text box will be applied. Note that input parameters are stored in the accompanying table and can be changed manually. Field names and formats need to remain as assigned, however.

Viewshed

This module will produce a visibility map where each data point of a terrain model will be assigned a true/false value (visible/not visible). 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

Depth below horizon

Rather than evaluating visibility as true/false, we can also calculate the depth at which lay invisible portions of the terrain. The value produced by this module can be understood as the theoretical height a construction should attain in order to appear on the horizon, as visible from the chosen observer point.

Parameters

Other parameters are the same as for the viewshed module.

See for more explanation on LandscapeArchaeology.org/2018/depth-below-horizon

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

Raster module: LandscapeArchaeology.org/2018/visibility-analysis-0-6/

Depth below horizon: LandscapeArchaeology.org/2018/depth-below-horizon

Intervisibility: LandscapeArchaeology.org/2019/intervisibility-qgis/