HOW TO

Determine the distance between a point feature and the nearest point feature in another layer

Last Published: November 11, 2021

Summary

The instructions provided describe how to determine the distance between the nearest point features from two different layers. For instance, to find the nearest distance between point features from a School layer and a Hospital layer.

Determining the distance between the nearest point features for the Hospital layer

Procedure

There are two ways to do this, by using geoprocessing tools, or by creating a spatial join.

Use geoprocessing tools

Use the Near tool or the Generate Near Table tool. Refer to ArcMap: Near and ArcMap: Generate Near Table for more information on how to use these tools.

Note:
The Near tool and the Generate Near Table tool are only available with an ArcGIS Desktop Advanced license.

Alternatively, use the Point Distance tool to calculate the distance between all point pairs in two point layers. Refer to ArcMap: Point Distance for more information.

Create a spatial join

Before creating the join, re-project the layers and data frame to have the same projection. Use either the Batch Project or the Project tool to change the coordinate system of the input layer. Refer to ArcMap: Batch Project and ArcMap: Project for more information.

  1. Create a spatial join by right-clicking the desired layer in the Table Of Contents > Joins and Relates > Join.
  2. In the Join Data window, select another layer to join with the desired layer.
  3. In the second option of the dialog, under You are joining: Points to Points, select the Each point will be given all the attributes of the point in the layer being joined that is closest to it, and a distance field showing how close that point is (in the units of the target layer). option.
The Join Data window with the Each point will be given all the attributes of the point in the layer being joined that is closest to it, and a distance field showing how close that point is (in the units of the target layer) option checked.
  1. Specify the output location, and click OK. A new layer containing the nearest distances is created.
The Join Data window with a output location specified.
  1. To determine the distance between the features, right-click the newly created layer, and select Open Attribute Table. In the table, the distance values are created in the Distance field.
The calculated distance under the Distance field in the attribute table of the newly created layer.
Note:
To convert the distances' values to other units of measurement, create a new field with the Double data type, and populate the distance values using the Field Calculator. Refer to ArcMap: About distance units and editing for more information. 

Article ID: 000012869

Software:
  • ArcMap

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options