# 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 <- "+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)
plot_viewshed(res)
## ... Arguments are past on to raster::plot
plot_viewshed(res, legend = TRUE, interpolate=TRUE, colNA="black",
col = topo.colors(15))
# }
Run the code above in your browser using DataLab