# Connecting Points with Lines for Adjacent Polygons

1037
3
06-25-2014 06:49 AM
New Contributor II
Hello,

I am having issues trying to find the right geoprocess that will do the following:

I have a polygon feature filled with polygons. I also have created a point feature which has all of the geographic centers for each polygon.

I would like to connect each point to points around that were generated from polygons that border the polygon. So if a polygon had 3 neighbor polygons, its geographic center would have a line to each of the 3 points that represent the geographic centers of neighboring polygons.

I do not have too much experience with creating map topologies or networks in general, but I have tried looking and I do not think there is a tool that would do this as I am asking, but I am likely wrong.

Does anyone have any experience creating graph networks like this? I have attached an example image that gives you an idea of what I am talking about.

Thanks!
Tags (3)
1 Solution

Accepted Solutions
New Contributor II
I found a solution that works!

1. First, you need to create the correct table with the polygon neighbors tool in ArcGIS.

2. Then, use the mean center tool to create points that are the geometric centers of each polygon (in my case, census block groups). Also make sure these points have a good identifier, I used a census block group unique GEOID.

3. Next, join the polygon neighbors table with a one to many process as described in the link I used above. You essentially join the table to the points using the GEOID and by selecting "keep only matching records", then you use the copy features tool to copy the points to a new layer that will have each of the points now, duplicated, and each record with an original point GEOID and a neighbor point GEOID.

4. This is where I found my new solution. I have a table with pairs of point GEOIDs, and the table currently had the Xcord and Ycord for each source point, so all I needed to do was another join based on the neighbor GEOID from the original layer of points to get in one layer both the original point coordinates and the neighbor coordinates.

5. Then I was able to use the XY to line tool, specifying the original x and y coordinate fields and the neighbor x and y coordinate fields. The only error I ran into was the output with all of the lines contains nothing but null values... I wish it would contain the GEOID's and the coordinates of the source points for the line. I have attached a picture below.

This ended up working and should be exactly what I need.

Can I get points for answering my own question? :cool:

Thank you Sol for your initial suggestion!
3 Replies
New Contributor II

Are you doing any custom development or are you trying to do it with only out-of-the-box GP tools?  What version of ArcGIS?  Is your data in SDE?

I am using out of the box ArcGIS 10.1. I do not believe I am using an SDE.

I think the polygon neighbors tool may work - I just need to think how to correctly join that table and use the points to line process from there.
New Contributor II
The one to many relationship may cause some difficulty,

Thank you Sol for your responses so far. I found a solution to the one to many issue, which is described here: http://gis.stackexchange.com/questions/2037/how-to-create-duplicate-features-based-on-related-table-...

For some reason, when you execute the copy features on the joined layer of points, you get duplicated points! So now I have a layer of points, many which are duplicates, which possess in the attribute table a new column listing the GEOID of a point that it is a neighbor to, and since the source has been duplicated, I know have all of the pair connections. Now it is just a matter of figuring out how to create lines between these points.
New Contributor II
I found a solution that works!

1. First, you need to create the correct table with the polygon neighbors tool in ArcGIS.

2. Then, use the mean center tool to create points that are the geometric centers of each polygon (in my case, census block groups). Also make sure these points have a good identifier, I used a census block group unique GEOID.

3. Next, join the polygon neighbors table with a one to many process as described in the link I used above. You essentially join the table to the points using the GEOID and by selecting "keep only matching records", then you use the copy features tool to copy the points to a new layer that will have each of the points now, duplicated, and each record with an original point GEOID and a neighbor point GEOID.

4. This is where I found my new solution. I have a table with pairs of point GEOIDs, and the table currently had the Xcord and Ycord for each source point, so all I needed to do was another join based on the neighbor GEOID from the original layer of points to get in one layer both the original point coordinates and the neighbor coordinates.

5. Then I was able to use the XY to line tool, specifying the original x and y coordinate fields and the neighbor x and y coordinate fields. The only error I ran into was the output with all of the lines contains nothing but null values... I wish it would contain the GEOID's and the coordinates of the source points for the line. I have attached a picture below.

This ended up working and should be exactly what I need.

Can I get points for answering my own question? :cool:

Thank you Sol for your initial suggestion!