debris¶
Debris reach, pressure, corridor blockage, navigable core and closed roads.
quakecascade.debris
¶
Debris reach, debris pressure and street closure after building collapse.
The module joins building damage to the road network in four steps:
reach_pairsfinds every building/road pair where the building's debris could physically land on the carriageway. The bound needs no coefficient: debris cannot land farther from the footprint than the building is tall.debris_pressurecombines the complete-damage probabilities of the buildings that reach each road into an upper-bound probability that at least one of them collapses onto it, and an expected number of collapses per 100 m.debris_extent,debris_envelopeandcorridor_blockageturn a collapse realisation into debris polygons and the share of each road corridor they cover, with an explicit closure threshold.navigable_coreandnavigable_roadskeep only the street space wide enough for a vehicle and return the ids of roads that no longer carry one, ready forRoadNetwork.without(edge_ids).
Every distance is in metres. Inputs are Shapely geometry arrays or
GeoDataFrames/GeoSeries; when a CRS is attached it must be a projected metric
CRS (quakecascade.crs.require_metric). Plain arrays carry no CRS, so
their units are the caller's responsibility.
Calibration notes. The debris spread factor k, the solid volume ratio,
the void ratio, the material density, the released-material fraction per
damage state and the closure share are screening constants without a single
verified value. They are therefore required arguments; the docstrings give
the literature range where one exists.
DAMAGE_STATES
module-attribute
¶
Hazus damage-state labels in increasing severity (FEMA, 2024, Hazus 6.1 Earthquake Model Technical Manual, building damage states).
NO_REACH
module-attribute
¶
Status when no building reaches the road: the zero is a true value.
Equal to quakecascade.contract.EMPTY.
NO_DAMAGE
module-attribute
¶
Status when every reaching building lacks a damage probability.
NO_WIDTH
module-attribute
¶
Status when a road has no usable corridor width.
NO_HEIGHT
module-attribute
¶
Status when the only buildings that may reach a road have no usable height.
NARROWER_THAN_CLEAR_WIDTH
module-attribute
¶
Status when a road is narrower than the vehicle clear width even before debris
(registered in quakecascade.contract.REGISTERED_STATUSES).
DebrisExtent
¶
Bases: NamedTuple
Per-building debris quantities; unpacks like the PlanX 4-tuple.
reach_pairs
¶
reach_pairs(
buildings_geom,
heights_m,
roads_geom,
road_widths_m=None,
*,
building_ids=None,
road_ids=None,
crs=None,
unknown_height_reach_m=None,
)
Building/road pairs where a collapsing building's debris can reach the carriageway.
Physical bound, no coefficient: debris cannot land farther from the
footprint than the building is tall. Distance d is measured from the
footprint polygon to the road centreline. Without widths the road is
the centreline itself; with widths w the carriageway edge lies
w / 2 from the centreline, so the clearance is d - w / 2. A pair
is kept when clearance < height (strict, as in the source).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
buildings_geom
|
GeoDataFrame, GeoSeries or sequence of Shapely geometries
|
Building footprints in a metric CRS. |
required |
heights_m
|
(array - like, scalar or str)
|
Building height in metres (a column name of |
required |
roads_geom
|
GeoDataFrame, GeoSeries or sequence of Shapely geometries
|
Road centrelines (or road polygons, then |
required |
road_widths_m
|
(array - like, scalar, str or None)
|
Full carriageway width in metres. |
None
|
building_ids
|
array - like or str
|
Stable ids carried into the output; default is row order. |
None
|
road_ids
|
array - like or str
|
Stable ids carried into the output; default is row order. |
None
|
crs
|
optional
|
CRS of plain geometry arrays, checked to be metric. Inputs that carry
different CRSs raise |
None
|
unknown_height_reach_m
|
float
|
Reach (m) assumed for buildings without a usable height, stored in
|
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
One row per pair: |
Notes
Re-implements the author's earlier road-exposure debris-reach rule with
a vectorised Shapely 2 STRtree dwithin query.
debris_pressure
¶
Debris pressure per road from the complete-damage probabilities of reaching buildings.
For road \(r\) with reaching buildings \(B_r\) that carry a probability \(p_i\) of the Hazus complete damage state:
\(P_r\) assumes independent collapses and counts every reaching
building as landing on the road, so it is an upper bound on the
probability that debris reaches the carriageway. It saturates on dense
streets; \(D_r\) (expected collapses per 100 m) keeps the ranking.
Buildings of unknown height that may reach the road (height_m NaN in
pairs) cannot be scored; they make the road partial (or
no_height when no other building reaches it), never empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p_complete
|
array - like
|
Probability of complete damage per building, indexed by the
|
required |
pairs
|
DataFrame
|
Output of |
required |
n_roads
|
int
|
Number of roads; inferred from |
None
|
road_length_m
|
array - like
|
Road length in metres; adds |
None
|
road_ids
|
array - like
|
Stable road ids; default the ids |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
One row per road:
|
Notes
Mirrors the status semantics of the author's earlier road-exposure stage (no reaching building / no input / partial / computed), re-implemented.
debris_extent
¶
debris_extent(
height_m,
area_m2,
state_factor,
*,
debris_factor=None,
solid_volume_ratio=None,
void_ratio=None,
density_t_m3=None,
)
Debris radius, solid volume, pile volume and mass per building.
with height \(H\) (m), footprint area \(A\) (m²), released-material fraction \(f \in [0, 1]\) (clipped), spread factor \(k\), solid volume ratio \(\rho_s\), void ratio \(e\) and the density \(\gamma\) (t/m³) of the void-free material, since the mass is taken from the solid volume. Radius scales linearly with \(f\), the conservative choice for screening.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
height_m
|
array - like
|
Height (m), footprint ground area (m², measured in a metric CRS) and released-material fraction (1 = total collapse). |
required |
area_m2
|
array - like
|
Height (m), footprint ground area (m², measured in a metric CRS) and released-material fraction (1 = total collapse). |
required |
state_factor
|
array - like
|
Height (m), footprint ground area (m², measured in a metric CRS) and released-material fraction (1 = total collapse). |
required |
debris_factor
|
(float, required)
|
|
None
|
solid_volume_ratio
|
(float, required)
|
Fraction of the gross building volume that is material. No verified source; PlanX's screening value was 0.3. |
None
|
void_ratio
|
(float, required)
|
Air share of the pile's bulk volume. No verified source; rubble piles are commonly described in the 0.3–0.5 range (PlanX screening value 0.35). |
None
|
density_t_m3
|
(float, required)
|
Density of the solid, void-free material (t/m³); it multiplies the
solid volume. No verified source (PlanX screening value 1.8). A
rubble bulk density (about 1.4–1.9 t/m³, voids included) belongs
with the pile volume instead ( |
None
|
Returns:
| Type | Description |
|---|---|
DebrisExtent
|
|
Notes
Ported from PlanX engine/seismic.py debris_extent with the
arithmetic unchanged; the former defaults are now required.
material_factor
¶
Released-material fraction per building from its damage state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
damage_state
|
array-like of str or int
|
State labels, or integer indices into |
required |
factors
|
(mapping, required)
|
Fraction released per state, e.g. |
required |
states
|
sequence of str
|
State order for integer input; default Hazus labels. |
DAMAGE_STATES
|
parse_width_m
¶
Lenient road-width parser: 7, "6.5", "6,5 m", "12 metres".
Returns float metres, or None when the value is missing, non-numeric,
non-positive or in another unit ("5 km"). Ported from PlanX.
highway_width_m
¶
Carriageway width (m) for a road class from a caller-supplied table.
Matching is case- and whitespace-tolerant and "_link" variants inherit
the parent class. No width table ships with the package: typical widths
per class are local design choices, so class_widths is required.
Unknown or missing classes get fallback, or NaN when it is None.
Accepts a scalar (returns float) or an array-like (returns ndarray).
debris_envelope
¶
Debris polygon per building: the footprint grown by r = k · H · f.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
buildings_geom
|
GeoDataFrame, GeoSeries or geometry sequence
|
Footprints in a metric CRS. |
required |
collapsed
|
array-like of bool
|
Buildings that release debris in this realisation. |
required |
heights_m
|
(array - like, scalar or str)
|
Height in metres. |
required |
k
|
(float, required)
|
Debris spread factor (see |
None
|
state_factor
|
array - like
|
Released-material fraction per building (default 1 where collapsed). |
None
|
Returns:
| Type | Description |
|---|---|
numpy.ndarray of object
|
Shapely polygon per building, |
unknown_height_envelope
¶
unknown_height_envelope(
buildings_geom,
collapsed,
heights_m,
k=None,
*,
unknown_height_reach_m=None,
state_factor=None,
crs=None,
)
Where debris of collapsed buildings without a usable height may land.
The footprint grown by k · H_u · f, with H_u the
unknown_height_reach_m bound of reach_pairs (required when
such a building exists). These polygons are not debris: a road they touch
is not closed by them, but its blockage or passability can no longer be
stated as complete.
Returns:
| Type | Description |
|---|---|
numpy.ndarray of object
|
Polygon per collapsed building of unknown height, |
road_corridors
¶
Corridor polygon per road: the centreline buffered by half its width (round caps).
Roads of zero width give an empty polygon.
corridor_blockage
¶
corridor_blockage(
buildings_geom,
roads_geom,
collapsed,
*,
heights_m,
k=None,
closed_share=None,
road_widths_m=None,
state_factor=None,
road_ids=None,
crs=None,
unknown_height_reach_m=None,
uncertain=None,
)
Share of each road corridor covered by debris, and a closure flag.
with corridor \(C_r\) (centreline buffered by half the width) and
debris polygons \(D_i\) from debris_envelope.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
buildings_geom
|
Footprints and centrelines in a metric CRS. |
required | |
roads_geom
|
Footprints and centrelines in a metric CRS. |
required | |
collapsed
|
array-like of bool
|
Collapse realisation per building. |
required |
heights_m
|
(array - like, scalar or str)
|
Building height (m). |
required |
k
|
(float, required)
|
Debris spread factor (see |
None
|
closed_share
|
(float, required)
|
Blocked share \(s^*\) at or above which a road counts as closed. No verified source; the IP3 screening study used 0.50. |
None
|
road_widths_m
|
(array - like, scalar or str, required)
|
Full carriageway width (m). |
None
|
state_factor
|
array - like
|
Released-material fraction per building. |
None
|
road_ids
|
array - like or str
|
Stable ids (default row order), as used by |
None
|
unknown_height_reach_m
|
float
|
Height bound for collapsed buildings without a usable height (see
|
None
|
uncertain
|
Shapely geometry, sequence or GeoSeries
|
Further areas where debris of unknown extent may lie, e.g. the envelopes of buildings whose damage state could not be computed. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Per road: |
Notes
Re-implements the buffer/union/intersection pass of the IP3 seismic-debris
analysis (detailed_planx_pass), vectorised with an STRtree.
closed_road_ids
¶
Ids of roads closed by debris, from corridor_blockage or navigable_roads.
column defaults to closed (blockage) or not passable (navigable).
For a navigable frame only roads that a vehicle could use before the
debris count (status computed or partial); roads that were never
passable (narrower_than_clear_width, no_width) are listed by
impassable_road_ids instead, so a before/after comparison can
drop them from both networks. The result feeds RoadNetwork.without.
impassable_road_ids
¶
Ids of roads a vehicle of the clear width cannot use even without debris.
From navigable_roads: status narrower_than_clear_width or
no_width. They belong out of the pre-event and the post-event
network; closing them only after the event would count them as debris
closures.
navigable_core
¶
Open street space narrowed to a minimum clear width (morphological opening).
Erode by half the clear width, then regrow by the same amount: every part
too narrow for a vehicle of width clear_width_m disappears, so a
0.5 m sliver beside a debris pile stops counting as a route. The opening
uses clear_width_m / 2 - tolerance_m so that a space exactly as wide
as the vehicle survives the erosion instead of collapsing to a line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
corridors
|
Shapely geometry or array of geometries
|
Open corridor polygons (street space minus debris), metric units. |
required |
clear_width_m
|
(float, required)
|
Minimum clear width (m). A local operational choice (vehicle width plus margin); no default. |
None
|
tolerance_m
|
float
|
Geometric tolerance (m), not a model coefficient: spaces narrower
than the clear width by less than |
0.001
|
Returns:
| Type | Description |
|---|---|
Shapely geometry or ndarray
|
Same shape as the input. |
Notes
Re-implements PlanX alg_seismic_debris._navigable_core (buffer with
8 segments per quadrant, then make_valid).
navigable_roads
¶
navigable_roads(
roads_geom,
debris,
road_widths_m,
clear_width_m=None,
*,
road_ids=None,
crs=None,
tolerance_m=1e-06,
width_tolerance_m=0.001,
uncertain=None,
)
Per-road passability after debris: does a vehicle still get from end to end?
For each road the open corridor is \(C_r \setminus \bigcup_i D_i\);
its navigable_core at clear_width_m is computed, and the road
is passable when one connected part of the core touches both centreline
end points. With round-capped corridors an undisturbed road is passable
exactly when its width is at least the clear width.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
roads_geom
|
GeoDataFrame, GeoSeries or geometry sequence
|
Road centrelines (LineStrings) in a metric CRS. |
required |
debris
|
Shapely geometry or sequence
|
Debris polygons (e.g. |
required |
road_widths_m
|
(array - like, scalar or str)
|
Full carriageway width (m). |
required |
clear_width_m
|
(float, required)
|
Minimum clear width (m). |
None
|
road_ids
|
array - like or str
|
Stable ids (default row order). |
None
|
tolerance_m
|
float
|
Numerical tolerance for touching an end point (geometric, not a model coefficient). |
1e-06
|
width_tolerance_m
|
float
|
Tolerance of the clear-width opening ( |
0.001
|
uncertain
|
Shapely geometry or sequence
|
Areas where debris of unknown extent may lie
( |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Per road: |