Viewshed¶
Calculates the viewshed of one or more viewpoints: the cells of the elevation model visible from them, with the number of viewpoints that see each cell. Each viewpoint is at a height above the elevation model, taken from a field of the points or from the default height, as the eyes of a person or the top of a tower. The cells not visible are no-data. The viewpoints on the border of the map are ignored.
It answers questions as what a planned building or antenna would be seen from, or which areas a set of observation points covers.
Parameters¶
Calculates the viewshed of one or more viewpoints on an elevation model: the cells visible from the viewpoints, with the number of viewpoints that see each cell. The cells not visible are no-data.
Toolbox folder: Geomorphology
Status: Experimental
Keywords: Viewshed, Visibility, Line of sight
Authors: Dr. John Lindsay
Class: org.hortonmachine.modules.Viewshed
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
raster file |
The elevation model. |
||
|
vector file |
The vector of the viewpoints. |
||
|
String |
|
The field of the points with their height above the elevation model. |
|
|
double |
m |
|
The height of the viewpoints above the elevation model, used when the points have no height field. |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
output file |
The map of the number of viewpoints from which each cell is visible. |
Example¶
The example runs on the sample elevation model of the manual, dtm_flanginec.tif in docs/manual/modules/maps/data, each module on the outputs of the previous ones:
import org.hortonmachine.modules.Viewshed
// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"
// what can be seen from the outlet of ExtractBasin, 2 m above the ground
var viewshed = new Viewshed()
viewshed.inRaster = folder + "dtm_flanginec.tif"
viewshed.inViewPoints = folder + "outlet.shp"
viewshed.pHeight = 2.0
viewshed.outViewshed = folder + "viewshed.tif"
viewshed.process()
The cells visible from the outlet of the basin of ExtractBasin, 2 m above the ground: the valley up to the ridges, and the slopes in front.¶