GRASS logo

NAME

r.los - Line-of-sight raster analysis program.

KEYWORDS

raster, viewshed, line of sight

SYNOPSIS

r.los
r.los --help
r.los [-c] input=name output=name coordinates=east,north [patt_map=name] [obs_elev=float] [max_dist=float] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-c
Consider earth curvature (current ellipsoid)
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

input=name [required]
Name of input elevation raster map
output=name [required]
Name for output raster map
coordinates=east,north [required]
Coordinates of the viewing position
patt_map=name
Binary (1/0) raster map to use as a mask
obs_elev=float
Viewing position height above the ground
Default: 1.75
max_dist=float
Maximum distance from the viewing point (meters)
Options: 0-5000000
Default: 10000

Table of contents

DESCRIPTION

r.los generates a raster output map in which the cells that are visible from a user-specified observer position are marked with the vertical angle (in degrees) required to see those cells (viewshed). A value of 0 is directly below the specified viewing position, 90 is due horizontal, and 180 is directly above the observer. The angle to the cell containing the viewing position is undefined and set to 180.

To run r.los, the user must specify at least an input map name, output map name, and the geographic coordinates of the user's viewing location; any remaining parameters whose values are unspecified will be set to their default values (see below).

The patt_map is the name of a binary (1/0) raster map layer in which cells within the areas of interest are assigned the category value '1', and all other cells are assigned the category value '0' or NULL. If this parameter is omitted, the analysis will be performed for the whole area within a certain distance of the viewing point inside the geographic region boundaries.
Default: assign all cells that are within the max_dist and within the user's current geographic region boundaries a value of 1.

The obs_elev parameter defines the height of the observer (in meters) above the viewing point's elevation.

The max_dist parameter is the maximum distance (in meters) from the viewing point inside of which the line of sight analysis will be performed. The cells outside this distance range are assigned a NULL value.

NOTES

For accurate results, the program must be run with the resolution of the geographic region set equal to the resolution of the data (see g.region).

The time to complete the calculation increases dramatically with the region size. Try to keep the columns and rows under 1000.

It is advisable to use a 'pattern layer' which identifies the areas of interest in which the line of sight analysis is required. Such a measure will reduce the time taken by the program to run.

The curvature of the Earth is not taken into account for these calculations. However, for interest's sake, a handy calculation for distance to the true horizon is approximated by d = sqrt(13*h) where h is the height of the observer in meters (above sea level) and d is the distance to the horizon in km. This may be useful for setting the max_dist value.

EXAMPLE

Spearfish example - calculation of viewshed from 50m tower on top of a mountain:
g.region raster=elevation.dem -p
r.los elevation.dem out=los coord=598869,4916642 obs_elev=50 max_dist=10000
r.colors -e los color=bgyr
d.shade shade=aspect color=los bright=10
echo "symbol extra/target 25 598869 4916642 red" | d.graph -m

TODO

a) Rewrite using ideas from r.cva and a method which scales better to large regions.
A suggested method is detailed in:
Izraelevitz, David (USACE).
'A Fast Algorithm for Approximate Viewshed Computation'
Photogrammetric Engineering & Remote Sensing, July 2003 b) or fix r.viewshed in Addons

SEE ALSO

g.region

AUTHOR

Kewan Q. Khawaja, Intelligent Engineering Systems Laboratory, M.I.T.

SOURCE CODE

Available at: r.los source code (history)


Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2020 GRASS Development Team, GRASS GIS 7.8.3dev Reference Manual