Diversity Indices

Corridor Designer Tools · Ancillary Corridor Tools · geoprocessing tool
Works at every ArcGIS Pro license level

Summary

Measures the neighborhood diversity of a categorical raster — each cell of the output describes how diverse the species, community, or category values are within a moving neighborhood around that cell. Choose among the major diversity measures: the effective number of species (Hill numbers, with a selectable order q — the default, and the most interpretable: the number of equally common categories that would give the same diversity), Shannon's index, the Gini-Simpson index, and Simpson's concentration (a dominance measure, where higher means less diverse). A raster whose attribute table carries more than one classification can be measured by any of them: choose the attribute field, and the cells are classified by that field's values before the diversity is computed. Neighborhoods may be rectangles, circles, annuli, wedges, or custom kernel files, with geodesic handling for geographic-coordinate rasters. A modernized, generalized port of the Land Facet Corridor Designer's ArcMap Shannon's Index tool; no Spatial Analyst needed.

Beyond corridor work, a diversity raster is a useful way to fold a categorical dataset into analyses that need continuous variables — for example, as a landscape variable in a Mahalanobis distance analysis, following Clark et al. (1993), who used exactly this kind of neighborhood-diversity derivative of their vegetation map.

Learn more About Land Facet Corridors covers the interspersion corridor, the strand that follows high facet diversity rather than any single facet. Step 5 of the Land Facet Tutorial runs this tool to make the diversity surface, with the tutorial data (41 MB) available to download so you can follow along.

In the Land Facet chain

Run on a land facet raster, Shannon's H′ is the interspersion surface of the Land Facet workflow: invert it with Invert Raster (reproducing the published 1/(H′ + 0.1) resistance) and model the facet-diversity corridor on the result.

A tour of the dialog

The example is Step 5 of the Land Facet Tutorial: the diversity of eighteen land facets in a 5-cell circle, measured with Shannon's index to follow the published method. The tool's default measure is the effective number of species, which is exp(H) at order 1 and ranks the landscape identically; the tutorial chooses Shannon's H so that the 1/(H′ + 0.1) resistance of the original work can be reproduced exactly.

The Corridor Designer Tools gallery open on the ribbon, with the Diversity Indices button, in the Ancillary Corridor Tools row, outlined in blue
Where to find it: Diversity Indices is in the Ancillary Corridor Tools row of the Corridor Designer Tools gallery, in the Corridor Designer Tools group of the Wildlife and Forestry tab.
The Diversity Indices geoprocessing pane: input categorical raster Land_Facet_Clusters, Classify by attribute field left at Value, output diversity raster Facet_Diversity, diversity measure Shannon's Index (H), neighborhood Circle, units Cells, radius 5, and the Return NoData if the neighborhood includes any NoData cell box unchecked
The facet raster in, the measure, and the neighborhood: a 5-cell circle, the original work's 5-pixel radius. The NoData option is left unchecked, as the manual advises for corridor work.
Shannon diversity of land facets over the study area as a white-to-green ramp from 0 to 2.4: dark green where many facets interleave along the dissected hills and mountain fronts, white on the uniform valley floor, and a gray NoData hole at the high Santa Rita summit where the outlier cells were excluded, with the wildland blocks outlined in yellow
Shannon's H of the facets, 0 to 2.4. Dark green is ground where many facets interleave within 150 m, the dissected hills and mountain fronts; white is uniform ground, one facet as far as the window reaches, on the valley floor. A window holding one facet reads exactly zero. The gray hole at the Santa Rita summit is NoData, not low diversity: those cells were excluded as outliers by the clustering and carry no facet.

Classifying by an attribute field

A categorical raster often carries more than one classification in its attribute table. The tutorial's land cover raster has 26 vegetation types in its Value column and, beside them, a Vegetation column naming them and an NLCD column grouping them into 10 broader classes; a Landfire EVT raster carries several such systems. The Classify by attribute field list offers Value, the default, under which every distinct cell value is its own class, plus every text or integer column of the attribute table. Choose a column and every cell is relabeled by it before the neighborhood counting, so the diversity is measured over that column's classes: the 10 NLCD groups rather than the 26 vegetation types. Cells sharing an entry become one class, a blank entry is its own class, and a cell value with no row in the table keeps a class of its own, with a warning. A raster without an attribute table offers only Value, and the list is disabled. This is the same regrouping the Cross-Tab Statistics window offers for its raster variables.

One caution for a land facet raster: keep Value. The facet is the cell value. Its attribute table also carries a Category column, which groups the facets by their first-pass class, four classes instead of eighteen, and a Cluster column, which is only the cluster number within each category. Classifying by Cluster merges unrelated facets, canyon-bottom cluster 1 with ridgetop cluster 1, into classes that mean nothing.

The example in the next section shows the option at work: the tutorial land cover raster classified by its NLCD column, with the dialog and the before and after maps.

The tool holds the whole raster 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 a raster is too large, clip it to the area you need first.

Why the effective number of species

Shannon's index has been the workhorse of diversity measurement since the 1940s, and it is still the right choice when a published method calls for it, as the land facet method does above. But the tool's default measure is the effective number of species, and the reason it has been gaining ground on the traditional indices is that it answers the question people actually ask. Shannon's H′ is measured in bits or nats of uncertainty; the Gini-Simpson index is a probability that two draws differ. Neither is a number of anything. The effective number is: it is the number of equally common categories that would give the same diversity, so a value of 4 means the neighborhood is as diverse as one holding four categories in equal shares, and a value of 12.7 means the equivalent of nearly thirteen.

That interpretability comes with a property the traditional indices lack, which Jost (2006) called the replication principle: double the diversity, in the sense of two equally diverse, non-overlapping communities put together, and the effective number doubles. Shannon's H′ rises by only 0.69 no matter how diverse the halves were, and the Gini-Simpson index, already compressed toward its ceiling of 1, barely moves at all. So a landscape with H′ of 2.0 is not twice as diverse as one with 1.0, and a Gini-Simpson of 0.9 against 0.8 hides a larger difference than it shows, whereas effective numbers of 7.4 and 2.7 mean what they say and can be compared, differenced and put in ratios without apology. This is also why the traditional indices are so hard to explain to a stakeholder, and why a map of effective numbers needs relatively little explanation.

The effective number is not a rival to the older indices so much as a common currency for them. Hill (1973) showed that richness, Shannon's index and Simpson's index are all members of one family, differing only in how much weight they give to rare categories, and that each converts to an effective number of species: richness as it stands, Shannon's H′ through exp(H′), and Simpson's concentration through its inverse. The order q below is that family's dial. Converting every index to the same units makes them comparable with one another, and it makes the choice among them a choice about rare categories rather than about scales.

The example below puts both ideas to work on the tutorial's land cover raster, which carries 26 vegetation types in its Value column and their 10 NLCD groups in an Nlcd column. The raster is in the tutorial data as aml_landcover (the run below used the copy clipped to the analysis area), so you can open its attribute table and see for yourself that it also carries a Vegetation column, naming each of the 26 types. Classifying by Nlcd and asking for the effective number of species gives a map of how many NLCD classes, in equal-share terms, surround each cell. Classifying by Vegetation instead would give an entirely different map, because a window that holds one NLCD class may hold several vegetation types within it: the same ground, measured at a finer classification, is more diverse. Which map is the right one depends on which classification matters to the question you are asking.

The tutorial land cover raster aml_landcover_clip symbolized by its Nlcd attribute field: scrub-shrub in blue over most of the area, grasslands in orange through the middle, evergreen forest in green on the hills, developed and agricultural land in dark green along the interstate, with woody wetland, barren lands and the other NLCD classes in small patches
Before: the land cover raster drawn by its NLCD column, ten classes where the Value column holds twenty-six.
The Diversity Indices geoprocessing pane: input categorical raster aml_landcover_clip, Classify by attribute field set to Nlcd, output diversity raster NLCD_Diversity, diversity measure Effective Number of Species with order q of 1, neighborhood Circle, units Cells, radius 5, and the NoData option unchecked
The dialog: the land cover raster classified by its Nlcd column, the effective number of species at q = 1, and a 5-cell circle.
The output raster NLCD_Diversity in a white-to-green ramp from 1 to 5.38, labeled Effective Number of NLCD Classes: near white over the uniform scrub of the valley, darker green along every boundary between NLCD classes and in the hills where forest, scrub and grassland interleave, with the interstate and its developed strip traced by a green outline
After: the effective number of NLCD classes within 150 m of each cell, from 1 where a single class fills the window to 5.4 where five or more interleave in near-equal shares. The uniform scrub reads as 1; every boundary between classes lights up, and the dissected hills, where forest, scrub and grassland meet, are the most diverse ground.

The order q, in one paragraph

The effective number of species (Hill numbers) comes with a dial: q = 0 is plain richness (every category counts equally, however rare); q = 1 (the default) weights categories by their abundance (exp of Shannon's H′); q = 2 emphasizes the dominant categories (inverse Simpson). Any q ≥ 0 is allowed, and running several makes a diversity profile. The effective number reads naturally: a value of 3.2 means the neighborhood is as diverse as one with 3.2 equally common categories. (Inverse Simpson is deliberately not a separate menu choice — it is the effective number at q = 2.)

ModelBuilder

A ModelBuilder diagram: Land_Facet_Clusters feeding Diversity Indices, producing Facet_Diversity
ModelBuilder: the categorical raster in, the diversity surface out, ready for Invert Raster.

Parameters

LabelExplanationData type
Input categorical raster (single band)Required · in_raster Each cell a class: a species, community, land-cover or land-facet code. A raster with thousands of distinct values is taken for a continuous one and refused. Raster Layer
Classify by attribute fieldOptional · class_field Value (default) treats every distinct cell value as its own class; any text or integer column of the raster's attribute table classifies the cells by that column instead. Only Value is offered when the raster has no attribute table. String
Output diversity rasterRequired · out_raster The continuous diversity surface, symbolized on delivery. A name inside a geodatabase gives a geodatabase raster; a name in a folder gives a GeoTIFF. Raster Dataset
Diversity measureRequired · index Effective Number of Species (default), Shannon's Index (H), Gini-Simpson Index (1 − D), or Simpson's Concentration (D). String
Order (q) for the effective numberOptional · q The Hill order: 0 richness, 1 (default) the exponential of Shannon's H, 2 inverse Simpson; any value at or above 0. Used only by the effective number. Double
NeighborhoodRequired · neighborhood Rectangle, Circle (default), Annulus, Wedge, Irregular or Weight; the last two read a kernel file. String
Neighborhood unitsOptional · nbr_units Cells (default), Meters, Kilometers, Feet or Miles for the dimensions below; ground units are handled geodesically on a geographic raster. String
Radius, Width, Height, Inner radius, Outer radius, Start angle, End angleOptional The dimensions of the chosen shape: radius for a circle; width and height for a rectangle; inner and outer radius for an annulus; radius and the two angles (degrees counter-clockwise from east) for a wedge. Only the ones the shape needs are enabled. Double
Kernel fileOptional · kernel_file A text file of cell weights for the Irregular (any nonzero = in) or Weight (weighted) neighborhood. File
Return NoData if the neighborhood includes any NoData cellOptional · exclude_null Unchecked (default), NoData cells are simply left out of the neighborhood's count; checked, any NoData cell in the window makes the output NoData. Boolean

Python

import arcpy
arcpy.ImportToolbox(r"C:\path\to\JennessEnterprisesTools.pyt")  # your install path
arcpy.jenness.DiversityIndices(
    in_raster=r"D:\tutorial.gdb\aml_landcover_clip",
    class_field="Nlcd",                     # or "Value" for the cell values
    out_raster=r"D:\tutorial.gdb\Effective_Number_NLCD",
    index="Effective Number of Species", q=1,
    neighborhood="Circle", nbr_units="Cells", radius=25)

Recommended citation

Jenness, J., B. Brost and P. Beier. 2026. Diversity Indices. 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), modernizing the Land Facet Corridor Designer's Shannon's Index tool (Jenness, Brost and Beier).

Licensing information

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