Skip to content

baptistehamon/lsapy

LSAPy Logo

LSAPy: Land Suitability Analysis in Python

Python Package Index Build Conda Version Supported Python Versions Project Status: Active - The project has reached a stable, usable state and is being actively developed. Testing Status Coverage Status (Coveralls) Ruff pre-commit.ci status Documentation Status Link to question issues Zenodo DOI

LSAPy stands for Land Suitability Analysis (LSA) in Python. Its objective is to make conducting LSA in Python easier and more accessible to users. It provides a set of objects built around xarray and operating together, making LSA's workflow straight forward and easy to understand.

Quick Start

To install LSAPy, you can use pip:

pip install lsapy

or conda:

conda install -c conda-forge lsapy

You can now perform your LSA:

# import modules
from lsapy import LandSuitabilityAnalysis, SuitabilityCriteria

# define your criteria
criteria = {
    "crit1": SuitabilityCriteria(
        name="criteria1",
        indicator=indicator1,  # xarray object
        func="function_name",
        fparams={"param1": value1, "param2": value2},
    ),
    "crit2": SuitabilityCriteria(
        name="criteria2",
        indicator=indicator2,  # xarray object
        func="another_function_name",
        fparams={"param1": value1, "param2": value2},
    ),
    # add all necessary criteria
}

# define your land suitability
lsa = LandSuitabilityAnalysis(
    land_use="land_use_name",
    criteria=criteria,
)

# run your analysis
lsa.run(params)

More detailed tutorials and examples can be found in the User Guide.

Contributing

LSAPy is an open-source project and we welcome contributions from the community. If you are interested in contributing, please refer to the Contribution section for guidelines on how to get started helping us improve the library.

Credits

The development of LSAPy started as part of a PhD, funded by the Food Transition 2050 Joint Postgraduate School and hosted by the University of Canterbury in New Zealand.

Food Transition 2050 Logo University of Canterbury Logo University of Canterbury Logo

The Python package has been created following the pyOpenSci Guidebook.