Calculates which cells of an elevation raster can be seen from each observer point.
Typical Uses
Siting antennas, towers, cameras, lookouts and wind turbines, and checking what they can see.
Assessing the visual impact of a proposed structure on the surrounding area.
Finding the areas hidden from a road, trail or viewpoint.
Combining several viewsheds: the area seen from at least one observer, or from all of them.
How does it work?
The transformer takes an elevation raster (a DEM or DSM) and a set of observer points. For each observer, it decides for every raster cell whether a straight line from the observer's eye to that cell (and to a point at the target height above it) passes above the terrain everywhere along the way. If it does, the cell is visible.
For each observer, the transformer outputs a raster with the same grid and coordinate system as the elevation raster. Each cell is 1 if it is visible, 0 if it is not, and 255 if it has no elevation data. The observer's own cell is always visible.
Observer Height
The observer's eye elevation is the ground elevation at the observer's location plus a height.
A 2D point has no height of its own, so the Observer Height Above Ground parameter is used.
A 3D point uses its Z coordinate, either as a height above the ground or as an absolute elevation, as set by 3D Observer Z Is. An absolute elevation below the surface is not valid, and that observer is rejected.
The ground elevation is the value of the cell that contains the observer point.
Methods
Fast (running horizon): Rays are cast from the observer to every cell on the edge of the raster. Along each ray, the transformer keeps the steepest slope seen so far, and a cell is visible if it rises to at least that slope. Cells are decided from the samples that fall on them. This takes a few seconds for a raster of 3,000 by 3,000 cells.
Exact (ray casting): Every cell gets its own line of sight, sampled at every cell width with the terrain height interpolated between cells. This is much slower, so it suits small rasters and checking the fast method.
The two methods agree on nearly all cells. In a test on a 3,000 by 3,000 raster, about 1% of the cells differed, and the fast method showed slightly more cells as visible. The cells that differ are along the edges of visible areas.
Earth Curvature and Refraction
Over long distances, the curvature of the Earth hides distant terrain. When correction is turned on, the transformer lowers each cell by the curvature drop at its distance from the observer, reduced by the effect of atmospheric refraction. The drop is about 0.6 m at 3 km and about 27 m at 20 km. The correction assumes a spherical Earth with a radius of 6,371 km and a refraction coefficient of 0.13, and that the raster's units are metres.
Usage Notes
Surface or terrain? A digital terrain model (bare ground) does not include buildings or trees, so they will not block the view. To include them, use a digital surface model.
Combining viewsheds. Each observer gives its own raster. To find the cells seen from at least one observer, or from all of them, combine the rasters with a transformer such as the RasterExpressionEvaluator or RasterMosaicker.
Several observers at once. Send all the observers to the Observers port together. The elevation raster is read once, and one raster is output per observer. The observer's attributes are kept on its raster, so they can be used to name outputs.
Attribute-driven heights. The height and distance parameters accept attribute values, so each observer can have its own.
Large rasters. Time and memory grow with the size of the raster. Setting Maximum Distance restricts the work to the area around each observer, which can save a lot of both.
Raster requirements. The raster must be in a projected coordinate system with linear units, with square cells and no rotation. Only the first band is used.
Configuration
Input Ports
DEM
The elevation raster. Rasters of any numeric type are accepted, and only the first band is used. Palette and colour rasters are rejected. Cells equal to the raster's nodata value are treated as having no data. Only one elevation raster is used per run, and any further ones are rejected.
Observers
The observer points, 2D or 3D. Features that are not points are rejected.
Output Ports
Viewshed
One raster per observer: 1 where the cell is visible, 0 where it is not, and 255 where the elevation raster has no data. The raster has the same grid and coordinate system as the elevation raster. The observer's attributes are kept, and these attributes are added:
_visible_cells: the number of visible cells.
_observer_elevation: the elevation of the observer's eye.
Observers and rasters that cannot be used. The fme_rejection_code and fme_rejection_message attributes say why, for example:
The observer is outside the elevation raster.
The observer is on a cell with no data.
The observer's absolute elevation is below the surface.
The elevation raster has non-square cells, is rotated, or has fewer than 3 by 3 cells.
No elevation raster arrived, so there was nothing to calculate the observer against.
Parameters
Observer Height Above Ground (2D observers)
The height of the observer's eye above the ground, in the units of the elevation raster. Used only for 2D observers. The default is 1.8.
Target Height Above Ground
The height above the ground of what is being looked at, in the units of the elevation raster. A cell is visible if this height above it can be seen. The default is 0, which means the ground itself.
3D Observer Z Is
How the Z coordinate of a 3D observer is read. Used only for 3D observers.
Height above ground: Z is added to the ground elevation. This is the default.
Absolute elevation: Z is the eye elevation. Observers below the surface are rejected.
Maximum Distance in DEM Units (0 = no limit)
Only cells within this distance of the observer are tested. Cells farther away are output as not visible. The default is 0, which means no limit.
Earth Curvature and Refraction Correction
No: The Earth is treated as flat. This is the default.
Yes: Cells are lowered by the curvature drop, reduced by refraction. Assumes metres.
Method
Fast (running horizon): This is the default.
Exact (ray casting, slow): Tests each cell with its own line of sight.
Rejected Feature Handling
Features that cannot be processed are output through the port, with the fme_rejection_code and fme_rejection_message attributes set.
Would you like to know more? Click here to find out more details!

