vvi_from_sf: Viewshed Visibility Index (VVI) from sf

View source: R/vvi_from_sf.R

vvi_from_sfR Documentation

Viewshed Visibility Index (VVI) from sf

Description

The VVI expresses the proportion of visible area to the total area based on a viewshed. The estimated VVI values range between 0 and 1, where 0 = no visible cells, and 1 = all of the cells are visible.

Usage

vvi_from_sf(
  observer,
  dsm_rast,
  dtm_rast,
  max_distance = 800,
  observer_height = 1.7,
  raster_res = NULL,
  spacing = raster_res,
  cores = 1,
  folder_path = NULL,
  progress = FALSE,
  output_type = c("VVI", "viewshed", "cumulative"),
  by_row = FALSE
)

Arguments

observer

object of class sf; Observer location(s) from where the VVI should be computed. See ‘Details’ for valid sf geometry types

dsm_rast

object of class rast; rast of the DSM

dtm_rast

object of class rast; rast of the DTM

max_distance

numeric; Buffer distance to calculate the viewshed

observer_height

numeric > 0; Height of the observer (e.g. 1.7 meters)

raster_res

optional; NULL or numeric > 0; Resolution that the GVI raster should be aggregated to. Needs to be a multible of the dsm_rast resolution

spacing

optional; numeric > 0; Only if observer is a linestring (or polygon), points on the line (or on a grid) will be generated. The spacing parameter sets the distance in between the points on the line/grid

cores

numeric; The number of cores to use, i.e. at most how many child processes will be run simultaneously

folder_path

optional; Folder path to where the output should be saved continuously. Must not inklude a filename extension (e.g. '.shp', '.gpkg').

progress

logical; Show progress bar and computation time?

output_type

A string. One of '"VVI"', '"viewshed"' or '"cumulative"'

by_row

Logical. Default 'FALSE'. Whether or not to return the result separately for each row in 'observer'. Only useful for lines or polygons.

Details

observer needs to be a geometry of type POINT, LINESTRING, MULTILINESTRING, POLYGON or MULTIPOLYGON. If observer is a LINESTRING or MULTILINESTRING, points will be generated along the line(s) every "resolution" meters. If observer is a POLYGON or MULTIPOLYGON, a grid with resolution = "resolution" will be generated, and VVI will be computed for every point. The CRS (st_crs) needs to have a metric unit!

Value

If 'output_type' is '"VVI"', an sf_object containing the VVI values as POINT features, where 0 = no visible cells, and 1 = all of the cells are visible. If 'output_type' is '"viewshed"', a 'SpatRaster' where cell values are equal to the number of times they are visible from observers. These values range from 0 to the number of observer points (depending on spacing). If 'output_type' is '"cumulative"' and 'by_row' is FALSE, a single number indicating the cumulative proportion of cells that are visible from at least one observer point inside the area determined by the union of observer points buffered by 'max_distance'. In case 'by_row' is TRUE, this will be a data.frame with columns 'rowid' (identifying each row in 'observer') and 'cvvi' (the cumulative viewshed visibility index).


STBrinkmann/GVI documentation built on March 11, 2024, 3:39 p.m.