# viewTo: Calculate Visibility between multiple locations In windfarmGA: Genetic Algorithm for Wind Farm Layout Optimization

## Description

Check if a location is visible from multiple locations

## Usage

 `1` ```viewTo(r, xy1, xy2, h1 = 0, h2 = 0, reso, plot = FALSE, ...) ```

## Arguments

 `r` A DEM raster `xy1` A vector/matrix with X and Y coordinates for Point 1 `xy2` A vector/matrix with X and Y coordinates for Point 2 `h1` A numeric giving the extra height offset for Point 1 `h2` A numeric giving the extra height offset for Point 2 `reso` The minimal resolution of the DEM raster. It is calculated in `viewshed` and passed along. `plot` Plot the process? Default is `FALSE` `...` Additional arguments passed to the raster plot

## Value

A boolean vector, indicating if `xy1` is visible from all elements of `xy2`

Other Viewshed Analysis: `cansee()`, `interpol_view()`, `plot_viewshed()`, `rasterprofile()`, `viewshed()`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16``` ```## Not run: library(raster) library(sf) matrix <- matrix(abs(rnorm(20, mean = 10, sd = 5)), nrow=5) r1 <- raster(matrix) shape <- st_as_sf(as(extent(r1), "SpatialPolygons")) locs = st_sample(shape, 10, type = "random"); mw <- methods::as(methods::as(r1, "SpatialPixelsDataFrame"), "SpatialPolygons") sample_xy <- st_coordinates(st_centroid(st_as_sf(mw))) viewTo(r1, sample_xy[4,], sample_xy, h1=1.8, h2=3, min(raster::res(r1)), plot=TRUE, interpolate=TRUE, asp=0.5) ## End(Not run) ```