Learn R Programming

windfarmGA (version 2.2.3)

plot_viewshed: Plot viewshed results

Description

Plot the result of viewshed

Usage

plot_viewshed(res, legend = FALSE, ...)

Arguments

res

The resulting list from viewshed

legend

Plot a legend? Default is FALSE

...

Is passed along to plot

See Also

Other Viewshed Analysis: cansee, interpol_view, rasterprofile, viewTo, viewshed

Other Plotting Functions: interpol_view, plot_cloud, plot_development, plot_evolution, plot_fitness_evolution, plot_heatmap, plot_parkfitness, plot_result, plot_windfarmGA, plot_windrose, random_search_single

Examples

Run this code
# NOT RUN {
library(sp)
library(raster)
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 <- "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000
+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
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)
plot_viewshed(res)

## ... Arguments are past on to raster::plot
plot_viewshed(res, legend = T, interpolate=T, colNA="black", 
              col = topo.colors(15))
# }

Run the code above in your browser using DataLab