Select to view content in your preferred language

Find minimum distance between multiple polygons

8483
7
Jump to solution
06-08-2016 07:07 AM
RobertFord1
Frequent Contributor


Hello all,

I am using ArcGIS 10.3 ArcInfo License.

I am looking for a way to calculate the distance between polygons that share the same attribute information.

For instance in the image below, I want to calculate the minimum distance between all polygons labeled 88709. So for this number, I would need 4 distances per polygon. I would also want to do the same for all those labeled 719 (9 distances per polygon) and 88719 (3 distances per polygon).

I am trying to find polygons in a feature class that have the same ID number but are far apart/not directly adjacent to each other. So in essence, island or orphaned polygons for lack of better terminology. In the image below, I would want to change the ID number for the 88709 polygon in the middle as well as the one in the lower left. I tried using the centroids and then doing a closest facility analysis but that does not produce the results I am looking for.

Thanks!

1 Solution

Accepted Solutions
RobertFord1
Frequent Contributor

Thanks Joe. I think I have what I need now. I used model builder to iterate feature selection while grouping by the ID number, then linked the iterated features to the Near tool input and output, and put each group of ID's into their own table.

Thanks again!

Here is a screenshot of my model:

View solution in original post

7 Replies
JoeBorgione
MVP Emeritus

Take a look at the Near tool; you are licensed for it.  Since you have multiple features that share the same id this is going to be a challenge for you;  you might want to create a summary table on ID to get a handle on how many multi-listings you have.  That might give you a method with which to iterate through with the near tool.

That should just about do it....
0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Are you working with Single or Multipart Polygons, i.e., are the polygons that share an attribute simply different parts of the same multipart polygon?

0 Kudos
RobertFord1
Frequent Contributor

Joe,

I have 255 ID numbers that are duplicated somewhere which makes 1,376 total polygons. I have also tried the Near tool but the issue is that the output does not tell me exactly which polygons are the ones I need to compare. I am thinking that I need to build a model of sorts that iterates over the ID number and calculates the distance between all polygons with the same number.

Joshua,

Some of them are multipart polygons but most are single.

0 Kudos
JoeBorgione
MVP Emeritus

I have also tried the Near tool but the issue is that the output does not tell me exactly which polygons are the ones I need to compare.

That's why I suggested iterating through the list of duplicates id's.

Simple Psuedo code might look something like:

Select polygon-id = ####

Perform Near on selected polygons

Look for the polygon oid that consistently has the greatest distance

That should just about do it....
0 Kudos
RobertFord1
Frequent Contributor

Thanks Joe. I think I have what I need now. I used model builder to iterate feature selection while grouping by the ID number, then linked the iterated features to the Near tool input and output, and put each group of ID's into their own table.

Thanks again!

Here is a screenshot of my model:

AzimjonSayidov
Emerging Contributor

Hello. Can you please make some elaboration on the model? I have similar situation with my geological map and really appreciate if you could tell where did you get this "Iterate Feature" from? Or if possible, could you provide it as a script? Thanks in advance.

Cheers.

Peter. 

0 Kudos
JoeBorgione
MVP Emeritus

start here:  A quick tour of using iterators—Help | ArcGIS Desktop 

That should just about do it....