riverarchitect.maxlifespan
Best-feature and maximum-lifespan mapping.
The open-source replacement for the ArcGIS MaxLifespan module. Lifespan mapping answers
“how long does this feature last here?”. Given the lifespan rasters of several candidate
features, this answers the planner’s question instead: which feature belongs here, and how
long will it last?
The rule is the one the original used:
max_lfis the cell-wise maximum across the feature lifespan rasters;a feature wins a cell where its own lifespan equals that maximum;
each winner is written as a mask raster and polygonised, so the result can be drawn as action areas on a map.
Ties are kept rather than broken: a cell where two features both reach the maximum appears in both layers. That is deliberate - it tells the planner the choice is theirs, and it is what the original did.
- class riverarchitect.maxlifespan.MaxLifespan(lifespan_dir, features=None, unit='us')[source]
Bases:
objectCombine per-feature lifespan rasters into a best-feature assessment.
- Parameters:
lifespan_dir (str) – directory holding
lf_<feature>.tifrasters, normally the output ofriverarchitect.lifespan.LifespanDesign.features (list) – feature ids to consider. Defaults to every
lf_*.tifpresent.unit (str) –
"us"or"si", for the area unit in the summary.
- Variables:
error (bool) – True when at least one feature could not be processed.
- property feature_ids
Feature ids that will take part in the assessment.