NEAR Tool Help

1510
4
07-04-2011 05:45 AM
HarishSP
New Contributor
I am new to ArcGIS, and I need some help with the use of the NEAR tool. I've created a shapefile that has a country border, and another shapefile with a set of points inside the country. They are in the same coordinate system and I use the UTM format (since I understand that it preserves distance measures).

I am trying to use the NEAR tool to find the distance between each of the points and the nearest border. The input features are the set of points, and the near feature is the border. However, when I run the NEAR tool, the distance calculated is always zero. I've tried using different search radii but the result in the same.

Could you please help. Thanks!
0 Kudos
4 Replies
DanLee
by Esri Regular Contributor
Esri Regular Contributor
I assume your borders are polygons. Near tool returns 0 distance because your points are inside their own polygons. You can try the following:

1. Run the Generate Near Table tool, specifying 2 for the "Maximum number of closest matches". The resulting table should contain two rows for each of the points: one row with a Near_DIST 0 and the other with a non-zero Near_DIST value.
2. Use Select By Attribute to select Near_DIST > 0.
3. Use Join Field tool to join the selected table rows with the points; you should be able to get the NERA_FID and NEAR_DIST fields transferred to the points.

Hope this helps.

If you need to know what are the shared borders, that would require more analysis. Is that your case?

Regards,
0 Kudos
HarishSP
New Contributor
Thanks! This is very useful. I will try it now.

I assume your borders are polygons. Near tool returns 0 distance because your points are inside their own polygons. You can try the following:

1. Run the Generate Near Table tool, specifying 2 for the "Maximum number of closest matches". The resulting table should contain two rows for each of the points: one row with a Near_DIST 0 and the other with a non-zero Near_DIST value.
2. Use Select By Attribute to select Near_DIST > 0.
3. Use Join Field tool to join the selected table rows with the points; you should be able to get the NERA_FID and NEAR_DIST fields transferred to the points.

Hope this helps.

If you need to know what are the shared borders, that would require more analysis. Is that your case?

Regards,
0 Kudos
DarrenWiens2
MVP Honored Contributor
If you have ArcInfo licensing, you can use the Feature to Line tool to make border lines, then Near to find the distances.
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Perhaps the Generate Near Table gives you the same distance as you get from Near to the border lines.

I was thinking Polygon To Line which gives you the Left_/Right_IDs on the output lines, if you need further information on the shared border lines. Do you need to analyze anything on the shared border lines? I am actually looking for a use case.

Thanks,
0 Kudos