Learn R Programming

windfarmGA (version 2.3.0)

viewshed: Calculate visibility

Description

Calculate visibility for given points in a given area.

Usage

viewshed(r, shape, turbine_locs, h1 = 0, h2 = 0)

Arguments

r

A DEM raster

shape

A SpatialPolygon of the windfarm area.

turbine_locs

Coordinates or SpatialPoint representing the wind turbines

h1

A numeric giving the extra height offset of Point 1

h2

A numeric giving the extra height offset of Point 2

Value

A list of 5, containing the boolean result for every cell, the raster cell points, a SimpleFeature Polygon of the given area and the DEM raster

See Also

Other Viewshed Analysis: cansee(), interpol_view(), plot_viewshed(), rasterprofile(), viewTo()

Examples

Run this code
# NOT RUN {
library(sp)
Polygon1 <- Polygon(rbind(c(4488182, 2667172), c(4488182, 2669343),
                          c(4499991, 2669343), c(4499991, 2667172)))
Polygon1 <- Polygons(list(Polygon1), 1);
Polygon1 <- SpatialPolygons(list(Polygon1))
Projection <- "+init=epsg:3035"
proj4string(Polygon1) <- CRS(Projection)
DEM_meter <- getDEM(Polygon1)

turbloc = spsample(DEM_meter[[2]], 10, type = "random");
res <- viewshed(r = DEM_meter[[1]], shape=DEM_meter[[2]], turbine_locs = turbloc,  h1=1.8, h2=50)
# }

Run the code above in your browser using DataLab