Land Facet Mahalanobis

Corridor Designer Tools · Land Facet Corridor Modeling · geoprocessing tool · by Jeff Jenness
Works at every ArcGIS Pro license level

Summary

One Mahalanobis distance cost surface per land facet: how far every cell on the landscape departs, in multivariate standard deviations, from the conditions typical of that facet. The third step of a Land Facet corridor analysis, after Land Facet Clustering and Land Facet Density. Low scores mark ground most like the facet — exactly what a least-cost model wants as resistance, so each facet's output raster feeds Least-Cost Corridor directly, with no inversion. No Spatial Analyst needed.

Learn more About Land Facet Corridors covers Mahalanobis distance as the cost of leaving a facet's own conditions, and why it is trained inside the wildland blocks; About Mahalanobis explains the distance itself, how it accounts for the variances and correlations among the variables, and how it relates to the chi-square distribution. Step 3 of the Land Facet Tutorial runs this tool to make one cost surface per facet, with the tutorial data (41 MB) available to download so you can follow along.

Trained inside the blocks, evaluated everywhere

Each facet's mean vector and covariance matrix come only from the facet's cells inside the Wildland Blocks — places known to support a working natural community, acting as training data — while the surface is evaluated over the whole analysis area, because a corridor has to cross the ground between the blocks and we need to find where block-quality ground occurs out there. For this tool, “Best” means most like what exists in the protected Wildland Blocks.

Why Mahalanobis rather than plain distance? The variables live in different units and are usually correlated — elevation in meters, steepness in degrees, density as a proportion — and a plain Euclidean distance would let whichever variable has the biggest numbers dominate. Mahalanobis distance normalizes by the variances and covariances, so every variable speaks with a fair voice (the full story is on the About Mahalanobis page). When a density raster is supplied, density joins the analysis with a characteristic value of 100% rather than its mean, as the Land Facet method requires — the ideal cell is thoroughly surrounded by its own facet.

Already a cost surface The D² (or D) output is low-is-good — a valid cost surface as-is. Never run it through Invert Raster; only the p-value output type behaves like a suitability surface (high is good) and needs inverting.

The tool validates its inputs' provenance records — a density raster from a different clustering run is refused rather than warned about, because a wrong band produces plausible-looking nonsense — and each facet's optional mean and covariance tables can be saved for inspection.

A tour of the dialog

The example is Step 3 of the Land Facet Tutorial: eighteen facets, three variables and the density raster from the previous step, with the two wildland blocks as the training polygons.

The Corridor Designer Tools gallery open on the ribbon, with the Land Facet Mahalanobis button, in the Land Facet Corridor Modeling row, outlined in blue
Where to find it: Land Facet Mahalanobis is in the Land Facet Corridor Modeling row of the Corridor Designer Tools gallery, in the Corridor Designer Tools group of the Wildlife and Forestry tab.
The Land Facet Mahalanobis geoprocessing pane: input land facet raster Land_Facet_Clusters, Wildland Blocks as training polygons, variable rasters Solar_Insolation_WHm2, Slope_Degrees and dem_m in the clustering order, land facet density raster Land_Facet_Clusters_Density, land facets to process empty for all, output workspace Test_Data.gdb, output name prefix Mahal_, output values Squared distance D2
The facet raster, the wildland blocks that restrict the sample, the variable rasters in the order the clustering used (the tool reads that order from the raster's record and checks it), the density raster, and a workspace and prefix for the outputs. Leave Land facets to process empty for all of them. Squared distance is the default output; the plain distance and a chi-square p-value are the alternatives.
One of the eighteen Mahalanobis cost surfaces, for Canyon bottom cluster 1, as a gray stretch from 0.11 in black to 397 in white over the whole landscape: the drainage bottoms dark, the high Santa Rita peaks bright white, the wildland blocks outlined in yellow
One of the eighteen cost surfaces the run wrote, for Canyon bottom, cluster 1. Dark is a small distance, ground much like the facet at its best, and therefore cheap to cross; white is far from it, here the high peaks of the Santa Rita block, ground so unlike any canyon bottom that the clustering step had already excluded it as outliers. The cost surface scores it anyway, at a distance to match, because every cell of the landscape gets a value, not only the cells inside the blocks and not only the cells that belong to a facet.

The tool holds all of its raster data in memory at once, so the memory it needs grows with the number of cells. On most rasters that is no concern. On a very large one the tool may need more memory than your computer has free, and then one of two things happens: Windows starts using the disk as overflow memory and the tool slows to a crawl, or the tool stops with an out-of-memory error. There is no fixed limit; it depends on how much memory your computer has free. If your rasters are too large, clip them to the area you need first.

ModelBuilder

A ModelBuilder diagram: Land_Facet_Clusters, Wildland Blocks, Solar_Insolation_WHm2, Slope_Degrees, dem_m, Land_Facet_Cluster_Density and the Test_Data.gdb workspace feeding Land Facet Mahalanobis, producing the output workspace and the derived cost-surface rasters
Facets, blocks, the three variables, the density raster and the workspace in; the per-facet cost surfaces out, ready for Least-Cost Corridor.

Parameters

LabelExplanationData type
Input land facet rasterRequired · in_raster The clustered facet raster. Raster Layer
Wildland BlocksRequired · blocks The training polygons. Feature Layer
Variable rastersRequired · variables The continuous variables, in the same order used for clustering. Multiple Value
Land facet density rasterOptional · density_raster Joins the analysis with its ideal pinned at 100%; provenance-validated. Raster Layer
Land facets to processOptional · facets Default: all. Multiple Value
Output workspace / prefixRequired · out_workspace, out_prefix One single-band cost raster per facet, named from the facet (default prefix Mahal_). Workspace / String
Output valuesRequired · out_type D² (default), D, or chi-square p-value. String
Covariance inversionOptional · inversion Standard inverse or SVD pseudo-inverse. String
Save statistics tablesOptional · save_tables Each facet's mean vector and covariance table, for inspection. Boolean

Python

import arcpy
arcpy.ImportToolbox(r"C:\path\to\JennessEnterprisesTools.pyt")  # your install path
arcpy.jenness.LandFacetMahalanobis(
    in_raster=r"D:\lf.gdb\Land_Facets",
    blocks="Wildland_Blocks",
    variables=r"D:\lf.gdb\elev;D:\lf.gdb\slope;D:\lf.gdb\insolation",
    density_raster=r"D:\lf.gdb\Facet_Density",
    out_workspace=r"D:\lf.gdb",
    out_type="Squared distance (D2)")

Recommended citation

Jenness, J., B. Brost and P. Beier. 2026. Land Facet Mahalanobis. Wildlife and Forestry Tools add-in for ArcGIS Pro, v. 1.99 (September 2026). Jenness Enterprises. Available at: https://github.com/JeffJenness/Wildlife_Tools.

Credits and references

By Jeff Jenness, Jenness Enterprises (www.jennessent.com), from the Land Facet Corridor Designer by Jenness, Brost and Beier.

Licensing information

Works at every ArcGIS Pro license level (Basic, Standard, Advanced). No extension licenses are required.