lsapy.LandSuitabilityAnalysis#
- class lsapy.LandSuitabilityAnalysis(land_use, criteria, short_name=None, long_name=None, description=None, comment=None)[source]#
Data structure to define and run land suitability analysis.
The land suitability analysis is defined by a set of suitability criteria that are combined to compute the suitability.
- Parameters:
land_use (str) – A name for the land use.
criteria (dict[str, SuitabilityCriteria]) – A dictionary of suitability criteria where the key is the name of the criteria.
short_name (str | None, optional) – A short name for the land suitability analysis. The default is None.
long_name (str | None, optional) – A long name for the land suitability analysis. The default is None.
description (str | None, optional) – A description for the land suitability analysis. The default is None.
comment (str | None, optional) – Additional information about the land suitability analysis.
Examples
Let first define the
SuitabilityCriteria(we use xclim package for the GDD computation):>>> from lsapy.utils import load_soil_data, load_climate_data >>> from lsapy.functions import SuitabilityFunction >>> from xclim.indicators.atmos import growing_degree_days
>>> soil_data = load_soil_data() >>> climate_data = load_climate_data() >>> sc = { ... "drainage_class": SuitabilityCriteria( ... name="drainage_class", ... long_name="Drainage Class Suitability", ... weight=3, ... category="soilTerrain", ... indicator=soil_data["DRC"], ... func=SuitabilityFunction( ... name="discrete", params={"rules": {"1": 0, "2": 0.1, "3": 0.5, "4": 0.9, "5": 1}} ... ), ... ), ... "growing_degree_days": SuitabilityCriteria( ... name="growing_degree_days", ... long_name="Growing Degree Days Suitability", ... weight=1, ... category="climate", ... indicator=growing_degree_days(climate_data["tas"], thresh="10 degC", freq="YS-JUL"), ... func=SuitabilityFunction(name="vetharaniam2022_eq5", params={"a": -1.41, "b": 801}), ... ), ... }
Now we can define the
LandSuitabilityAnalysis:>>> lsa = LandSuitabilityAnalysis( ... land_use="land_use", ... short_name="land_suitability_analysis", ... long_name="Land Suitability Analysis", ... criteria=sc, ... )
The land suitability analysis can now be run:
>>> lsa.run(inplace=True)
- __init__(land_use, criteria, short_name=None, long_name=None, description=None, comment=None)[source]#
Methods
__init__(land_use, criteria[, short_name, ...])run([suitability_type, agg_methods, ...])Run the land suitability analysis.
Attributes
attrsDictionary of attributes of the land suitability analysis.