5

I have a point layer and I want to calculate the distance from each point to a number of line features (rivers, roads etc.). Using the "Near" tool I can do this for one feature at a time (eg rivers) and I get 2 new fields in the attribute table indicating the id of the nearest feature and the distance. Fine. However, trying to find distance to the next features (eg roads) simply overwrites the previous ones (for rivers). The problem is I want to get distances to multiple features and get them all added separately to the attribute table. I tried to change the field name to see if this helped but I can only change the "Alias" so it makes no difference. I am working in Arcmap 10.0. Thanks.

3

You are correct, the Near tool only generates the distance to the single nearest feature.

ArcGIS can do this using the Generate Near Table option, also in the Analysis -> Proximity section of the toolbox. More information here: http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/Gp_ToolRef/analysis_tools/generate_near_table_analysis_.htm - be sure to untick the "Find only closest feature" box.

Once the table has been generated, you can use joins to join it back up to your spatial data.

Note: I believe it may require an ArcInfo level license.

2

The Near tool overwrites the NEAR_FID and NEAR_DIST fields each time the tool is run. You will need to Add Field using a name that corresponds to each line layer (e.g. distriver, distroad, etc.) that you used Near to calculate the distances for, and then Calculate Field equal to the NEAR_DIST values. Then run the Near tool on the next line layer and repeat until all line layers have distances copied in to unique field names in the attribute table.

An alternative to the Near tool (and useful for anyone without an ArcInfo license) is Spatial Join with the CLOSEST match_option, where you can enter a unique distance_field_name. This results in a redundant output that must be used as the input to the next Spatial Join with another line layer and unique distance_field_name and so on...

With Spatial Analyst, you can create Euclidean Distance rasters to each of the line layers, name the output rasters as distriver, distroad, etc. and then use Extract Multi Values to Points to get the distance values into the point layer attribute table. You will need to decide on appropriate cell size for your distance rasters, but these layers are then available for additional modeling if needed.

0

Having not seen these answers before, I used a workaround method - after running the 'near' function, I exported the data as a CSV before running the next 'near' function - so at the end I had one .csv for each two-way comparison I was interested in, and then copy-pasted those columns into one database.

Export process: Go into the attribute table, drop down the 'table options' menu to 'export', change the output table location to the desired folder, change the file type to 'text file', and remove the '.txt' extension from the filename.

  • You can also just open the dbf of the shapefile in OpenOffice and edit the field names. No exporting necessary. – farrenthorpe Dec 20 '17 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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