For each cell of the elevation raster map, count the number of cells from which it can be seen (mode=all):
r.cva elevation=MyDEM mode=all
For each cell that contains a point in an input vector map, compute the binary viewshed (0=invisible, 1=visible) from it and accumulate the results for all points (mode=sites):
r.cva -f elevation=MyDEM sites=observers output=visibility mode=sites
DESCRIPTION
This program performs multiple line-of-sight checks between one or more observer cells and
multiple target cells within a distance threshold from the current observer. The number of target cells within all unbroken lines of sight is recorded for each observer and stored in the
raster output map as a cumulative count.
Two fundamental types of visibility can be computed:
In addition, there are several modes of operation, specified using the mode option:
The definition of which cells constitute "observers" depends on the mode of operation:
The cells used in the analysis can be constrained by one or both of two masks. Both masks must be binary raster maps in which the areas of interest are coded "1" and all other cells "0". target_mask determines which cells are targets: a cell which is not a target will be returned as not visible from a given viewpoint even if it is actually visible according to the line-of-sight analysis (i.e. this mask performs the same function as patt_map in r.los). obs_mask constrains which cells may be treated as observers. For example, suppose that the raster map "no_sea" codes sea (elevation = 0) as "0" and land (elevation > 0) as "1". In this case, specifying "no_sea" as the target_mask would cause r.cva to count cells on land that are visible from any observer cell. Alternatively, specifying "no_sea" as the obs_mask would count any cells visible from observers on land. Finally, specifying "no_sea" as both the target_mask and obs_mask would count cells on land that are visible from observers on land.
The geometry of the potential line of sight between each pair of cells may be altered by means of two offsets, obs_elev and target_elev. The value of obs_elev is added to each observation cell and the height target_elev to each target cell. Note that by swapping these values it is possible to produce maps showing the number of cells from which an observer is visible, or if the -f flag is set, the number of observer cells which it is possible to see from each other cell.
A particular set of observer cells in a random sample can be repeated by specifying the same value for seed. Alternatively, different values can be used to produce independent samples for statistical testing.
d(height)=dist^2/(2*Re)
With Re being the radius of the earth (ca. 6,356,766 m).
Note also that you can use the same control values in operation modes
other than "sites", if you specify the equivalent options
(see above). The latter will also work
as global settings in "sites" mode. Attributes stored in the vector
map table will override these global settings unless the -i
flag is specified. The meaning of OFFSETA, OFFSETB and RADIUS1 is
the same as obs_elev, target_elev and max_dist. The latter still
exists for compatibility with earlier versions of r.cva.
NOTES
Input sites can also be 3D points, in which case absolute observer elevation is represented
by the Z coordinate. If spot= has been specified or a "SPOT" attribute is present
in the input vector map's attribute table, then these settings will override the Z coordinate.
Make sure that the "top" and "bottom" settings of the current region are set to a range that
encompasses all points of interest (use g.region -p -3 to review current 3D region
settings).
r.cva works in the current GRASS region, but ignores the current mask. Masking is achieved by specifying "target_mask" and/or "obs_mask". For accurate results, the program must be run with the resolution of the region set equal to the resolution of the elevation raster map/DEM (see g.region).
It is assumed that N-S and E-W resolution of the current region are the same. If they differ, distances thresholds for limiting the line-of-sight distance will be imprecise.
The number of cells visible from a given observer location includes the observer itself only if the observer is a target cell. Consequently, if neither the observer cell nor any other cell within max_dist of it is a target cell, then the size of that observer's viewshed will be zero. Set the -m flag to locate such observers (they will show as cells coded "0" as opposed to "-1"). Similarly, set the -m flag when the -f flag has been set in order to differentiate cells which are genuinely not visible from any observer as opposed to those that are not target cells.
r.cva always informs the user what sampling frequency was attempted and subsequently achieved. This information is printed to the screen and is also placed in the output map's history file (which can be viewed using r.info). The sample attempted may differ slightly from that requested owing to the need to sample a whole number of cells. Any such discrepancy will be greatest in the case of small regions and low resolution. The sample achieved may be further reduced when an obs_mask has been specified. This will not occur with the option "random", because its algorithm repeatedly allocates observers until the number that fall within mask cells coded "1" produces the frequency attempted. Such a reduction can, however, occur with the options "all", "systematic" and "sites", because their algorithms allocate observers without reference to the mask and then simply ignore those that fall in mask cells coded "0".
This program's memory footprint is small, but computation times can be excessive for large regions. If this becomes a problem in mode "all", consider using modes "systematic" or "random" instead. In addition, consider using as a smaller setting for max_dist.
The default option values for observer/target heights and distance limits assume that the map units are meters.
When max_dist is set to 100, the N-S and E-W resolutions are 50, and a target_mask has been specified, the cells immediately NE, SE, SW and NW of the viewpoint may not be masked when they should be. Please report any others that you find to the author.
Note that r.cva fixes two bugs in the original version of r.los: that obs_elev is truncated to its integer component and that the target mask (patt_map in r.los) does not apply to the viewpoint or its eight immediate neighbours.
Cumulative viewshed analysis was defined by D. Wheatley, 1995, `Cumulative viewshed analysis: a GIS-based method for investigating intervisibility, and its archaeological application', in G. R. Lock and Z. Stancic (eds.) Archaeology and Geographic Information Systems: A European Perspective, London: Taylor and Francis, pp. 171-186.
Lake et al. (M. W. Lake, P. E. Woodman and S. J. Mithen, 1998, `Tailoring GIS software for archaeological applications: an example concerning viewshed analysis', Journal of Archaeological Science 25: 27-38) discuss the first version of r.cva and provide some timing estimates. They also discuss the importance of eliminating the edge effect that occurs when calculating the number of cells visible from a viewpoint that is closer than max_dist to the edge of the map.
Fisher et al. (P. Fisher, C. Farrelly, A. Maddocks and C. Ruggles, 1997, `Spatial Analysis of Visible Areas from the Bronze Age Cairns of Mull', Journal of Archaeological Science 24: 581--592) provide a useful review of some of the pitfalls that may trap unwary users of cumulative viewshed analysis. Most of these are easily avoided using r.cva.
With contributions by: Benjamin Ducke, Institute of Archaeology, University of Kiel, Germany.
The first version of r.cva was written by the author as part of the MAGICAL Project directed by Dr. Steven Mithen (Dept. of Archaeology, University of Reading, U.K.). The MAGICAL Project was made possible by a Natural Environment Research Council award (NERC GR3/9540) to Dr. Mithen.
r.cva draws heavily on the code for r.los, which was written by Kewan Q. Khawaja, Intelligent Engineering Systems Laboratory, M.I.T.
Adaptation to GRASS 6 vector and raster formats, additional functionality, documentation updates by Benjamin Ducke.
Last changed: 2015-11-10