visibility

Visibility and viewshed analysis.

visibility_graph

visibility_graph
(
bldgs_gdf : geopandas.geodataframe.GeoDataFrame
bounds : tuple[float, float, float, float]
out_path : str
from_crs_code : int | str
to_crs_code : int | str | None = None
view_distance : int = 100
resolution : int = 1
)

Run a visibility graph analysis. This will return three TIFF image files, respectively showing a density, farness, and harmonic closeness based measure.

Parameters

bldgs_gdf
gpd.GeoDataFrame

A GeoDataFrame containing building polygons.

bounds
tuple[float, float, float, float]

A tuple specifying the bounds corresponding to the provided from_crs_code parameter.

out_path
str

An output path to which the generated TIFF images will be written. The pathname will be appended to correspond to the density, farness, and harmonic closeness measures.

from_crs_code
int | str

The EPSG coordinate reference code corresponding to the input data.

to_crs_code
int | str | None = None

An output EPSG coordinate reference code. None by default, in which case a UTM projection will be used.

view_distance
int = 100

The view distance within which to run the visibility analysis. 100m by default.

resolution
int = 1

The spatial resolution in metres to use when generating the raster. Lower resolutions will result in faster analysis.

visibility_graph_from_osm

visibility_graph_from_osm
(
bounds_wgs : tuple[float, float, float, float]
out_path : str
to_crs_code : int | str | None = None
view_distance : int = 100
resolution : int = 1
)

Retrieves OSM buildings for the specified WGS bounds and runs a visibility analysis. This will return three TIFF image files, respectively showing a density, farness, and harmonic closeness based measure.

Parameters

bounds_wgs
tuple[float, float, float, float]

A tuple specifying the bounds corresponding to the provided from_crs_code parameter.

out_path
str

An output path to which the generated TIFF images will be written. The pathname will be appended to correspond to the density, farness, and harmonic closeness measures.

to_crs_code
int | str | None = None

An output EPSG coordinate reference code. None by default, in which case a UTM projection will be used.

view_distance
int = 100

The view distance within which to run the visibility analysis. 100m by default.

resolution
int = 1

The spatial resolution in metres to use when generating the raster. Lower resolutions will result in faster analysis.

viewshed

viewshed
(
bldgs_gdf : geopandas.geodataframe.GeoDataFrame
bounds : tuple[float, float, float, float]
origin_x : float
origin_y : float
out_path : str
from_crs_code : int | str
to_crs_code : int | str | None = None
view_distance : int = 100
resolution : int = 1
)

Run a viewshed analysis from a specified point. Writes an output image to the specified output path.

Parameters

bldgs_gdf
gpd.GeoDataFrame

A GeoDataFrame containing building polygons.

bounds
tuple[float, float, float, float]

A tuple specifying the bounds corresponding to the provided from_crs_code parameter.

origin_x
float

An easting or longitude for the origin of the viewshed in the from_crs_code coordinate reference system.

origin_y
float

A northing or latitude for the origin of the viewshed in the from_crs_code coordinate reference system.

out_path
str

An output path to which the generated TIFF images will be written. The pathname will be appended to correspond to the density, farness, and harmonic closeness measures.

from_crs_code
int | str

The EPSG coordinate reference code corresponding to the input data.

to_crs_code
int | str | None = None

An output EPSG coordinate reference code. None by default, in which case a UTM projection will be used.

view_distance
int = 100

The view distance within which to run the visibility analysis. 100m by default.

resolution
int = 1

The spatial resolution in metres to use when generating the raster. Lower resolutions will result in faster analysis.

viewshed_from_osm

viewshed_from_osm
(
bounds_wgs : tuple[float, float, float, float]
origin_lng : int
origin_lat : int
out_path : str
to_crs_code : int | str | None = None
view_distance : int = 100
resolution : int = 1
)

Run a viewshed analysis from a specified point using OSM data. Writes an output image to the specified output path.

Parameters

bounds_wgs
tuple[float, float, float, float]

A tuple specifying the bounds corresponding to the provided from_crs_code parameter.

origin_lng
float

A longitude for the origin of the viewshed in WGS84 coordinates.

origin_lat
float

A latitude for the origin of the viewshed in WGS84 coordinates.

out_path
str

An output path to which the generated TIFF images will be written. The pathname will be appended to correspond to the density, farness, and harmonic closeness measures.

to_crs_code
int | str | None = None

An output EPSG coordinate reference code. None by default, in which case a UTM projection will be used.

view_distance
int = 100

The view distance within which to run the visibility analysis. 100m by default.

resolution
int = 1

The spatial resolution in metres to use when generating the raster. Lower resolutions will result in faster analysis.