Hawth's Analysis Tools for ArcGIS


 You are here: Home > Hawths Tools > Tools Descriptions & Help


Input: point layer
Output:various tables representing distances or summary statistics of distances between points

  • a tool with several options to tailor the output
  • the output can take three forms: a) a complete distance matrix (a table of the distance between each point and every other point), b) a summary statistics table of the distances (designed for large sample sizes), and c) a table listing the closest point (their ID’s and the distance from the point in question)
  • provides an option to process only the selected features in a point layer, with two further sub-options to create output based on only those points, or on all points
  • requires a unqiue ID field to be specified, and although it is best for this field to be a long integer type, the program will also process text (string) ID’s


  • the output is a comma delimited textfile (.csv), no other formats are supported
  • when creating the full distance matrix table, if you have more than 255 columns you may not be able to open the table in software like Excel which is limited to 255 columns
  • does not work with data in a Geographic Coordinate system (distances calculated using spherical coordinate systems are not valid because the x and y axes are not proportional across space)
  • does not perform on-the-fly projection changes, so the source files MUST be in a projected coordinate system (users cannot just change the projection of the map window)

[Click for larger view]


Figures A-D. A shapefile with a relatively small number of points (27) is used in this example (A). In this example the shapefile has an attribute field called UID that contains the unique ID values as long integers (1 through 27). The first output example (B) shows the upper left hand corner of the complete distance matrix. (The red arrows are intended to represent that only a small portion of the full output table is shown in the picture). Thus we can see that the distance between points with the unique ID’s of 1 and 5 is 13009.9. The complete distance matrix is generally only an appropriate output for small sample sizes. For larger sample size, the output can take the form of a summary statistics table (C) which contains the minimum, maximum, and mean distances from the point in question to all other points, as well as the standard deviation of those distances. In addition to either of these first two output format, the user can opt to output a table that lists the distance and unique ID of the points that are closest to the point in question (D). The user can specify the closest N points to include in this table, where N = any number from 1-100 provided this is not greater than the sample size.


Getting started. A point layer must be loaded into ArcMap in order to use this tool. If your point layer is an event theme and you are experiencing problems, try making it a shapefile and trying again (right click on the event theme in the Table of Contents, select Data, then Export Data). The point layer MUST be in projected coordinate system like UTM or SPC, not a Geographic (Lat/Lon) coordinate system.

Selected a unique ID field When you select a point layer from the first drop-down box, all possible unique ID (UID) fields are listed in the next drop-down box. A UID field will ideally be an integer field, although the tool can accomodate text (string) fields. Given the choice, select an integer field.

Using only selected features. When you select a point layer from the drop down list the program checks to see if there are selected features in that layer, and enables the “Use selected features only” option. If you select this option then only the selected features will be processed. However, you must then pick between two further options. The first option specifies that distances between points are calculated by referencing ONLY the selected features. The second option specifies that the distances are calculated by referencing ALL locations (but only for the selected points). This is a fairly subtle but important distinction as it has a profound influence on the result.

Listing nearest neighbours. The nearest neighbour results are output to a separate comma delimited file. Use the “Find the top N closest points (max=100)” number box to define how many points will be listed. If you select just 1 point, then all that will be listed is the single closest point. If you select 5, then the 5 closest points are listed in order of their proximity, with the closest points always occuring first in the list (as you will be able to see from the distances that are also output to that table). Note that in the case of points that are equidistant, one of those points is selected arbitrarily as the closest. Note that the nearest neighbour output file is automatically named based on the folder and file name of the other output table. [Note to programmers: this routine uses the HeapSort method.]

Processing time. If you have a large number of points, this program may take a considerable amount of time to run. It is recommended that you try running a test on a smaller sample (e.g. 1000 points) before embarking on more ambitious analyses.

Home | Articles | Services || Hawth's Tools:  Overview | Description | Download | FAQ