Visibility from raster data

Generate a visibility analysis from raster data. This approach allows for blending building footprints with Digital Elevation Model (DEM) data to take elevation into account.

from cityseer.metrics import visibility

Use the visibility module to create a visibility analysis from raster data. The visibility will be generated based on the raster data provided to the visibility_from_raster method.

Pay particular attention to:

There is a performance trade-off for the view_distance and input file resolution. A larger view_distance or higher resolution will result in a more detailed graph but may take longer to compute and require more memory.

visibility.visibility_from_raster(
    "recipes/visibility/images/madrid_rast_ht.tif",
    "recipes/visibility/images/madrid_vis_from_rast",
    view_distance=100,
    observer_height=1.5,
)  # defaults to local UTM
INFO:cityseer.metrics.visibility:Running visibility graph from raster file: /Users/gareth/dev/cityseer-examples/recipes/visibility/images/madrid_rast_ht.tif.
INFO:cityseer.metrics.visibility:Raster resolution: 2.0 meters per pixel
100%|██████████| 638775/638775 [00:40<00:00, 15663.54it/s]

Visualised as harmonic on a dataset of building rasters including building rooftop heights. (No DEM data used in this example.)