Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

In ArcGIS how might one calculate as an attribute value the distance to the nearest polygon of type X? Say we have a point layer of wildlife observations and we want to know how far each of them is from the nearest wetland.

Please note if your answer is specific to arcgis v9 or 10 and the necessary license level.

share|improve this question
add comment

5 Answers

up vote 6 down vote accepted

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.

share|improve this answer
    
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]". –  matt wilkie Oct 18 '10 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 Oct 19 '10 at 0:02
add comment

In ArcGIS 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 10 and an ArcInfo license you can do the same thing with the ArcGIS 10 Near tool.

Hope this helps!

share|improve this answer
    
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. –  matt wilkie Oct 18 '10 at 20:15
add comment

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.

share|improve this answer
    
thank you for providing info on how to properly use the tool, going beyond "here use this, it works" –  matt wilkie Oct 18 '10 at 19:54
add comment

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.)

share|improve this answer
    
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. –  matt wilkie Oct 18 '10 at 20:17
add comment

In Arc10.1 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 separate 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 are more focused on linking attributes of features in the same area.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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