bluegreencity-ki

Drought Tolerance Criterion

Description

This criterion evaluates the drought tolerance of tree species from the Citree enrichment already attached to the tree layer during input loading. The risk assessment is performed on a scale from 0 to 1, where higher values indicate higher risk.

The current implementation reads citree_trockenheitstoleranz by default and requires the drought-tolerance mapping to be configured explicitly in config.yaml. Unknown or unmatched species fall back to the project’s neutral score (default 0.5).

Risk Mapping

Drought tolerance is converted into risk values as follows:

Tolerance Level (config key) Risk Value
sehr tolerant 0.1
trockentolerant 0.3
mittel 0.5
empfindlich 0.8
vertraegt keine trockenheit 0.8
unbekannt 0.5
(leer / “”) 0.5

Key spelling matters: the mapping lookup lowercases and strips the incoming value but does not convert umlauts. The Citree label uses the ASCII spelling vertraegt keine trockenheit; a key with „verträgt” would never match and silently score 0.5 (neutral) instead of 0.8.

unbekannt is a catalog value with an explicit mapping key (0.5) in the live config; species not covered by any key surface as the raw value unknown and receive the neutral score.

Configuration

The criterion is configured in the config.yaml file as follows (mapping is STRICT — no fallback to defaults):

- name: "drought_tolerance"
  weight: 0.004708          # calibrated value; see config/config.yaml
  params:
    source_column: "citree_trockenheitstoleranz"
    mapping:
      sehr tolerant: 0.1
      trockentolerant: 0.3
      mittel: 0.5
      empfindlich: 0.8
      vertraegt keine trockenheit: 0.8
      unbekannt: 0.5
      "": 0.5  # Empty/missing values

mapping is mandatory. If it is missing, the criterion raises a RuntimeError instead of silently using defaults.

If needed, source_column can be pointed at a different enrichment field. In the normal pipeline this should stay on the Citree enrichment column.

Data Sources

The criterion reads the value from the tree layer after enrichment:

This avoids maintaining a second manual species table for the same information.

Example

A tree with the species “Acer platanoides” has a drought tolerance of “trockentolerant”, which corresponds to a risk value of 0.3.

Implementation

The implementation is located in bluegreencity_ki/criteria/drought_tolerance.py.

Main Methods

Tests

Tests for this criterion are located in tests/test_drought_tolerance.py.

Test Cases

  1. Risk Mapping: Verifies that drought tolerance values are correctly converted into risk values.
  2. Call Method: Tests the __call__ method of the drought tolerance criterion.

Integration

This criterion is integrated into the risk assessment process and contributes with its calibrated weight (current: 0.004708, see config/config.yaml) to the overall evaluation.

Notes On Current Behavior