Distinguishing corridors from fragments in a habitat map

It's not a full solution but, check out these tools for connectivity analysis (the first approximates well what you are searching):

  • MSPA - Morphological Spatial Pattern Analysis (http://forest.jrc.ec.europa.eu/download/software/guidos/mspa) from GUIDOS toolbox (http://forest.jrc.ec.europa.eu/download/software/guidos) and

  • Conefor Sensinode (http://www.conefor.org/).

Also consider training a machine learning algorithm to classify your instances (corridor vs. fragments). You can give spatial attributes at patch level (e.g., patch size, perimeter area-ratio, circle ratio) and distance-based features (e.g., distance to fragments) to classify. For calculating the patch-level features needed for classification you can try FragStats (https://www.umass.edu/landeco/research/fragstats/fragstats.html).

You can also consider a simpler 'expert-based rule system' to classify each instance. For example, corridors will have higher perimeter-area ratio than habitat fragments and so on..

More interesting stuff here for connectivity analyses: http://conservationcorridor.org/corridor-toolbox/programs-and-tools/

However, the fact that some corridors don't have 'full pixel connectivity' will be an issue that you need to sort out first. I think that you have to define some kind of a distance-based threshold criteria to decide if some pixel is part of a corridor or not.


Before starting any analysis, I would highly recommend applying a filter to your data to clean up the "salt and pepper" effect. Any algorithm will struggle with the current structural pattern of your data. A simple focal majority would likely yield undesirable results. A more robust method is applying a sieve approach, where a minimal-mapping-unit can be specified. This can be done via the gdal_sieve.py function in GDAL, the raster > analysis > sieve function in QGIS or the sieve function in the ArcGIS Gradient Metrics Toolbox.

This looks like something that could be addressed with Mathematical Morphology operators (eg., extracting roads from imagery). I would imagine that a dilation operator followed by a Closing operator would clarify the corridors. You could then apply an Opening operator, to remove the corridors, and difference the rasters to pull the identified corridors as separate objects. These types of image decomposition functions are somewhat automated in the MSPA and GUIDOS software but, once again, would be notably effected by the discontinuities in your data.

There is a QGIS plug-in for MSPA as well as available functions in GRASS (available through the QGIS GUI). One of the issues with MSPA and GUIDOS is that you are limited in the image size. Unfortunately, in ESRI software, morphological operators are only available in the ArcScan extension. With some digging you will find other software options as well as methods for defining morphological operators through raster algebra with custom kernel matrices.

Another approach would be edge detection filtering methods such as a Sobal kernel operator. There is a sobal function in the ArcGIS Gradient Metrics Toolbox as well as in the spatialEco R package. The advantage of the R implementation is that you can return the gradient function of the operator whereas the ArcGIS implementation only returns the 1`st order function (which may be all you need). I believe that the Orfeo toolbox (available as a QGIS add-on) has a sobal option in the EdgeExtraction function.