Distance matrix between ALL features in ArcGIS

Viewed 523

I have 20 000 polygons in a dataset. I need to have the Euclidean Distance between all polygons, so a 20 000 x 20 000 distance matrix where for each of the polygons, the distance to all other polygons is stored.

I have read in some other threads the recommendation to use the "Near" tool in Arcmap. However, this tool only calculates the distance to the NEAREST polygon, while I need the distance from ALL polygons to ALL polygons.

Is there any solution for this?

Near tool: Calculates distance and additional proximity information between the input features and the closest feature in another layer or feature class.

1 Answers

In order to calculate the distance between the centroids of each of your polygons make sure your map is in a projected coordinate system. Then, make sure the centroid points are calculated (detailed step-by-step here: https://support.esri.com/en/technical-article/000009381 )

Export your centroid point attribute table as a DBF (Click on Options > Export.)

Add the table to your map. Right click on the new table, Display XY Data, select Longitude for the X and Latitude for Y, and select the map's coordinate system to create an events layer.

Then, use the Point Distance tool (Details here: https://desktop.arcgis.com/en/arcmap/10.3/tools/analysis-toolbox/point-distance.htm ). The event points are both the input and near features. The output will be a table displaying distance between all polygon centroids on the map.

Related