xrspatial.viewshed.viewshed(raster: xarray.core.dataarray.DataArray, x: Union[int, float], y: Union[int, float], observer_elev: float = 0, target_elev: float = 0)xarray.core.dataarray.DataArray[source]

Calculate viewshed of a raster (the visible cells in the raster) for the given viewpoint (observer) location.

raster: xarray.DataArray

Input raster image.

x: int, float

x-coordinate in data space of observer location.

y: int, float

y-coordinate in data space of observer location.

observer_elev: float

Observer elevation above the terrain.

target_elev: float

Target elevation offset above the terrain.

viewshed: xarray.DataArray

A cell x in the visibility grid is recorded as follows: - If it is invisible, then x is set to INVISIBLE. - If it is visible, then x is set to the vertical angle w.r.t the viewpoint.