horizonangle | R Documentation |
horizonangle
is used to calculate the tangent of the angle to the horizon in a specified direction.
horizonangle(dtm, azimuth, reso = 1)
dtm |
a SpatRaster object, two-dimensional array or matrix of elevations (m). If not a SpatRaster, orientated as if derived from a raster using |
azimuth |
a numeric value representing the direction of the horizon as, for example, returned by |
reso |
a single numeric value representing the spatial resolution of |
To enable calculation of horizon angles near the edge of dtm
a 100 pixel buffer is of
zeros is placed around it. NAs in dtm
are converted to zeros.
The projection system used must be such that units of x, y and z are identical. Use
terra::project()
to convert the projection to a Universal Transverse Mercator type
projection system. If dtm
is a SpatRaster object, a SpatRaster object is returned.
a SpatRaster object or two-dimensional array of numeric values representing the tangent of the angle to the horizon in a specified direction.
library(terra)
ha <- horizonangle(dtm1m, 0)
plot(ha, main = "Tangent of angle to horizon")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.