plot_viewshed | R Documentation |
Calculate and plot visibility for given points in a given area.
plot_viewshed(r, turbine_locs, h1 = 0, h2 = 0, plot = TRUE, ...)
r |
The elevation SpatRaster |
turbine_locs |
Coordinates, SpatialPoint or SimpleFeature Points representing the wind turbines |
h1 |
A single number or numeric vector giving the extra height offsets
for the |
h2 |
The height offset for Point 2 |
plot |
Should the result be plotted. Default is |
... |
forwarded to |
A mosaiced SpatRaster, representing the visibility for all turbine_locs
library(sf)
library(terra)
f <- system.file("ex/elev.tif", package = "terra")
r <- rast(f)
x <- project(r, "EPSG:2169")
shape <- sf::st_as_sf(as.polygons(terra::boundaries(x)))
plot(shape)
st_crs(shape) <- 2169
locs <- st_sample(shape, 10, type = "random")
plot_viewshed(x, locs, h1 = 0, h2 = 0, plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.