In ArcGIS Desktop, can you calculate as an attribute value the distance to the nearest polygon of type X?

Assume we have a point layer of wildlife observations and we want to know how far each of them is from the nearest wetland.

Your answer should mention whether it is specific to ArcGIS Desktop v9 or 10, and the necessary license level.

5 Answers 5


Performing a Spatial Join will do this. Right click on the point layer and choose "Joins and Relates > "Join". In the Join Data dialog box, choose "Join data from another layer based on spatial location" in the drop down. Then choose the polygon layer you want joined. Then choose the radio button that says "is closest to it". (The selections are a little different if you're joining points to lines)

This function is also available in ArcToolbox, which is supposed to give better performance with large datasets, and provides some extra functionality.

This method is available in all versions of ArcGIS, and at all license levels.

  • Thanks, in 9.3.1 this worked provided the destination was within a file geodatabase. Attempting to output to shapefile yields the error "Can't create output feture class. The Field type is invalid or unsupported for the operation.[Overrride]". Commented Oct 18, 2010 at 20:03
  • Matt- I just tested shapefile output in ArcGIS 10, and it worked fine for me. The error you're getting leads me to believe the problem might be with your specific data. This page might lead to an answer: resources.esri.com/help/9.3/ArcGISDesktop/com/Gp_ToolRef/…
    – Don Meltz
    Commented Oct 19, 2010 at 0:02

In ArcGIS Desktop 9.3, with an ArcInfo license you can use the Near tool for this. In ArcMap make a feature selection on the polygon layer for type 'X', load them into the Near tool with the points as the input feature and the polygons as a near feature and it should work.

Likewise with ArcGIS Desktop 10 and an ArcInfo license you can do the same thing with the ArcGIS 10 Near tool.

  • In 9.3 this ran swiftly and gave results (readers take note: this alters attributes of input feature class), however the values are not right for this use case. All points in the input layer were said to be X metres from the same individual entity in the comparison feature class instead of the closest polygon. I did not investigate to see alternate parameters would give better results. I accepted the defaults. A reading of the help topic indicates this should have worked. Commented Oct 18, 2010 at 20:15

Point distance is among the free tools in the otherwise commercial ET GeoWizards extension. It works with all license levels of ArcGIS 9 and 10.

Point distance will compute the distance from points to the boundary edge of the nearest polygon. The tool does not respect layer selections or query definitions, instead it uses the underlying feature class directly. If your wetlands are a subset of your polygons, you have to export them into a separate feature class before.

The user guide suggests to convert the polygons into polylines if you need the distance to the boundary, but that seems not to be necessary -- I've just checked with a small data set.


In ArcGIS 10.1 for Desktop there are 3 tools that will complete this task:

  1. Near
  2. Near3d (3d analyst)
  3. Generate Near Table

Both Near and Near 3d will change your original data while Generate Near Table will create a seperate table output.
Near 3d may be the best option for mountainous terrain with high relief, but if you lack the 3d analyst license or are working with meadows then elevation will likely not skew your distances.

These tools seem specifically designed for your task while spatial joins is more focused on linking attributes of features in the same area.


If you have a large dataset of points or a large and complex set of polygons, it's worth considering a raster-based solution: construct the Euclidean distance grid for the polygons and extract its values at the point locations. This method works with a lot of other software, too. It requires a Spatial Analyst license. It also doesn't have all the bugs with spatial joins that are present in ArcGIS through version 9.something. (Arc 10 seems to be much faster and more reliable with spatial joins.)

  • 1
    Bugs in spatial joins? I'm happy to open another question on known bugs in 9.x spatial joins if the specifics can be described. Commented Oct 18, 2010 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.