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_pathmust point at a surface model (DSM: first-return elevations including rooftops);dtm_pathat the bare-earth terrain model. Per building,baseis thebase_statof the terrain under the footprint andheightis thetop_statof 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
heightextra:rasterioandrasterstats.