plot_viewshed: Plot visibility

View source: R/visibility.R

plot_viewshedR 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 turbine_locs

h2

The height offset for Point 2

plot

Should the result be plotted. Default is TRUE

...

forwarded to terra::plot

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)


YsoSirius/windfarmGA documentation built on March 13, 2024, 8:37 a.m.