cityImage.buildings_height_from_dem_dtm#

cityImage.buildings_height_from_dem_dtm(buildings_gdf, dem_path, dtm_path, base_stat='mean', top_stat='max', all_touched=False, min_valid_elev=-50)[source]#

Compute per-building base elevation and height from DEM and DTM rasters.

dem_path must point at a surface model (DSM: first-return elevations including rooftops); dtm_path at the bare-earth terrain model. Per building, base is the base_stat of the terrain under the footprint and height is the top_stat of the surface minus that base — i.e. an above-ground height, not an absolute elevation.

Warning

Buildings whose footprint does not intersect the raster extent are dropped from the returned frame (and an error is raised when none intersect). Use assign_elevations_from_rasters() for a non-destructive variant that merges results back onto the full input frame.

Requires the optional height extra: rasterio and rasterstats.