plot_viewshed {windfarmGA} | R Documentation |
Plot visibility
Description
Calculate and plot visibility for given points in a given area.
Usage
plot_viewshed(r, turbine_locs, h1 = 0, h2 = 0, plot = TRUE, ...)
Arguments
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 |
Value
A mosaiced SpatRaster, representing the visibility for all turbine_locs
Examples
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)
[Package windfarmGA version 4.0.0 Index]