Select points based on minimum connection lines

1025
17
10-03-2016 10:27 AM
LanoYado
New Contributor III

I am using Model Builder and I have two layers; point and line. I want to select (and then create a point layer of them) those points that have less connections with other points. 

For instant, point # 6 is connected to 5 points (# 11, 16, 20, 47, & 19) through 5 lines. Among these five points, # 47 is the one I want to find it since it has only 2 connections with others (# 6 & # 54), the rest have more lines connected to (#19 connected to 3 lines, # 11 connected to 4 lines, #16 connected to 3 lines, #20 connected to 3 lines). 

Note that I already calculated (created a field)  the number of lines connected to each point using spatial join.

Any way to use in ModelBuilder?

0 Kudos
17 Replies
DanPatterson_Retired
MVP Esteemed Contributor

add the XY coordinates to the polyline shapefile using the first and last point option

Add Geometry Attributes—Help | ArcGIS for Desktop 

Then you can try summarizing by one of the coordinates or a pair.  Given your current pattern where there is unlikely to be no duplicate X or Y values, unless they are the start or end, this should simplify things.  

One tip might be to one step further....

  • Calculate the start and end X and Y values as per usual.
  • add two new fields and determine the minimum X and Y per line start-end.  This willl account for a point in one line being the end in another
  • summarize one and/or more of the fields in the usual way to get a count of the replication of the coordinates

There are other ways... for example, relates (using rounded truncated coordinates as text etc).  or exporting the point coordinates and doing a lexicographic sort (by x, then Y) and then do a rolling difference to count the spacing between difference indices (requires numpy)

LanoYado
New Contributor III

Thanks Dan, I will try with your first way since it looks like easier to me.

0 Kudos
AbdullahAnter
Regular Contributor II

Genius,Dan

ChrisDonohue__GISP
MVP Frequent Contributor

(scratch this - just realized in re-reading the post that you already did this part)

Chris Donohue, GISP

0 Kudos
LanoYado
New Contributor III

Thank you Chris and yes, I have calculated the lines connected to each point using spatial join but the problem is how can I select among these points the one with less connections.

0 Kudos
ChrisDonohue__GISP
MVP Frequent Contributor

How about Select (Analysis)  ArcGIS Help (10.2, 10.2.1, and 10.2.2)Click on the SQL button to the right of "Expression (optional)" to enter your selection criteria.

Chris Donohue, GISP

0 Kudos
LanoYado
New Contributor III

That works perfectly. Can we generalize it to ask and select the one with minimum connections? in this example, I just say Join_Count=2. How can we select in general to say:

Join_Count= minimum one (2 in this case)?

0 Kudos
LanoYado
New Contributor III

I created the condition using 'get value' with 'statistics summary' but the value can not be read by "select" tool.

0 Kudos
ChrisDonohue__GISP
MVP Frequent Contributor

I was just doing the same thing and ran into the same issue.  The Select will work with a hard-coded value (like 1), but doesn't seem to accept Value or its various permutations (like %Value%).  Odd.

Chris Donohue, GISP

0 Kudos