Geographic Distance Matrix

Titleā€ƒ Geographic Distance Matrix


Computes a full pairwise distance matrix between all input locations. Calculations are performed using Vincenty's formulae, accurate to within 0.5mm.


This tool will run in Python for small and medium sized datasets (up to 200 rows), and larger datasets will be computed via ArcObjects for performance.


DistanceMatrix (Input_Feature_Class, Distance_Units, Matrix_Type, Output_Matrix)

Parameter Explanation Data Type
Input_Feature_Class Dialog Reference

Input points to be used for distance calculations.

Feature Layer
Distance_Units Dialog Reference

Preferred units for the distance matrix. Calculations are performed internally in meters, but can be converted as needed via this parameter.

Matrix_Type Dialog Reference

'Square matrix' produces a standard distance matrix, with the diagonal computing distances to self, and other locations representing the pairwise distance. Distances are here assumed to be symmetrical between any pair.

'Square matrix (SPAGeDi formatted)' produces the same result, but includes additional metadata columns required by SPAGeDi.

Output_Matrix Dialog Reference

The resulting distance matrix, output as a comma separated value (CSV) file. The first row and column both contain the identifiers of the input dataset, which are defined by the OBJECT_ID field within the input data layer by default.


Code Samples


analysis, geodesic, matrix, distance


Created by the geneGIS team: Dori Dick, Shaun Walbridge, Scott Baker, Dawn Wright

Use limitations