ai4er-cdt / geograph

GeoGraph provides a tool for analysing habitat fragmentation and related problems in landscape ecology. GeoGraph builds a geospatially referenced graph from land cover or field survey data and enables graph-based landscape ecology analysis as well as interactive visualizations.
https://geograph.readthedocs.io
MIT License
39 stars 10 forks source link

[feature] functionality and tutorial for landscape connectivity analysis #76

Open CWen001 opened 3 years ago

CWen001 commented 3 years ago

Hello. The package has already provided an excellent presentation of the graph structure of a landscape, mostly for visualization and component/disconnection identification. Is it possible to take one step further, by providing a toolkit to analyze more landscape connectivity indexes? Like dPC, IIC, IF and more?

herbiebradley commented 3 years ago

Thank you for the feedback @CWen001 - we will add some of the indexes you mention to the list of metrics included in the package in the next release. In the meantime, you can implement whatever metric you like yourself using the geograph.metrics.Metric class, for example:


from geograph.metrics import Metric
# pass GeoGraph object to custom function to calculate IIC
def iic_metric(geo_graph: geograph.GeoGraph) -> Metric:
    ...
    # calculate IIC here from geo_graph
    ...
    return Metric(
        value=iic_value,
        name="IIC",
        description="Integral index of connectivity.",
    )

geo_graph.metrics["IIC"] = iic_metric(geo_graph)