Near Tool

2530
23
Jump to solution
01-10-2012 10:37 AM
ABDALLAMOHAMED
Occasional Contributor
Hello. I used Near tool in ArcMap 10 to calculate the near distnace and I got some fields with zeros value. Then I used the same layer in ArcMap 9.3, and I got near distance field without zeros values. I couldn't figure out the reason for that.Any hint.Appreciate. Thanks1
0 Kudos
1 Solution

Accepted Solutions
DanLee
by Esri Regular Contributor
Esri Regular Contributor
I am glad to hear that. You are very welcome!  🙂

View solution in original post

0 Kudos
23 Replies
ABDALLAMOHAMED
Occasional Contributor
Regarding the above post, can any one tell me how to find near distance with out the zero values I'm getting?????Thanks!
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
There are cases where near distance is 0, for example if you have a point inside a polygon, the near distance from the point to the polygon is 0; if you have two polygons that have shared boundary, the distance from one polygon to the other is 0. It would be helpful that you provide more detail about your cases or share a sample data.
0 Kudos
ABDALLAMOHAMED
Occasional Contributor
Okay..I have raster layer, and I wanted  first  to combine cells that are adjacent and diagonal. To do so , I used Region Group with option �??EIGHT�?� , �??CROSS�?� option for zone grouping method. Secondly, I wanted to derive the nearest distances for each polygon. So I converted the resulting raster to polygon. Then I used the NEAR tool to get the nearest distance. The problem is I'm getting Near distance with zeros values, which shouldn't be so. So the problem is how to get rid of these zeros, or my model might be from the beignning was wrong, don't know..Any hint on that..Appreciate...
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Have a look of the Generate Near Table tool, which allows you to specify a Max. Number of Closest Matches. You can specify a number and delete the ones of zero values in the result. You may need to run the Summary Statistics to get the minimum values if you find more than one near features for each polygon.
0 Kudos
ABDALLAMOHAMED
Occasional Contributor
Dan..  Thanks for your input..I have more than half a million records, and so deleting the zeros is not practical, Plus having zeros is an indication that there is something wrong going on. Because to my knowledge the Near distance shouldn't be zeros. There should be a distance between one polygon and another.. Don't know..
Thanks!..
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Would you be able to share a sample data - a few polygons that you get zero for NEAR_DIST - so that we can investigate what may be wrong?

As I said earlier, if two polygons are touching or intersecting, the near distance from one to the other is zero. Are you saying that your polygons are not touching and you get zero near distance between them? What is the XY Tolerance of your data (check the properties of your feature class)? Did you set the XY Tolerance.

Oh another thing: is your data projected? If not, meaning they are in decimal degrees, then the near_dist will be in decimal degrees and very likely with zeros. You would need to apply an appropriate projection so that your features would be in meters or feet for the proximity analysis.
0 Kudos
ABDALLAMOHAMED
Occasional Contributor
Dan..Thanks for your message.The table below shows the polygons having near distance zeros. I also attached a file with this message showing sample of these polygons. It is true that some of the polygons are touching each other. I was trying to fix that by using the Dissolve tool, but didn't work well in getting rid of the touching. Also my data is projected in meters so no problem with that..Let me know. Thanks a lot!






FID Shape IDGRIDCODE NEAR_FID NEAR_DIST
68 Polygon 69 2011 70 0
70 Polygon 71 2011 68 0
72 Polygon 73 2011 70 0
79 Polygon 80 2011 72 30
80 Polygon 81 2011 84 0
84 Polygon 85 2011 80 0
88 Polygon 89 2011 92 30
91 Polygon 92 2011 99 42.426407
92 Polygon 93 2011 96 0
96 Polygon 97 2011 92 0
99 Polygon 100 2011 96 0
101 Polygon 102 2011 99 0
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Did you attach the sample data?
0 Kudos
ABDALLAMOHAMED
Occasional Contributor
Yes I did but don't know if i did it right or not.I clicked on manage attachments and then I attached the file..
0 Kudos