Select to view content in your preferred language

NEIGHBOR POLYGONS: SUM LENGTH OF LINES IN A POLYGON AND ITS NEIGHBORS

1721
11
05-24-2011 01:21 AM
pernilleparmer
Emerging Contributor
Hi.

I have over 10 000 polylines spread over 430 polygons. For each polygon I have summarized the length of all polylines within the polygon. Now I would like to extend the sum to all polylines within the center polygon and its neighbor polygons. That is: if polygon 1 is neighbor with polygon 2, 3 and 4, I like to find the sum of all polylines within the polygons 1,2,3 and 4. I hope to do this for all 430 polygons, so I need a tool to help me.

Do anyone know how to do this?

Any help would be great=)

Thanks.
0 Kudos
11 Replies
ChrisSnyder
Honored Contributor
Hope you know some Python.

There are a few ways of determning adjacency in ArcGIS that I use:

1. Use a SelectByLocation to select polygons that touch/intersecct/share line segment with/etc.
2. Use the PolygonToLine tool. The output lines will have fields indicating the OBJECTID of the polygon to the right and left of the arc... I mean line (just like a good ole' coverage .aat)!
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
If you have the ArcInfo license, you can try the Generate Near Table tool:
- Specify a small search distance (e.g. 1 meter/feet) if you are only interested polygons that share boundary with the central polygon. All the neighboring polygons should get 0 for NEAR_DIST.
- Uncheck "Find only closest feature (optional)", so that you are not only getting one of the neighbors.

Then you use the Join Field tool to join the near table by the NEAR_FID field with your polygon feature class by the FID field to get the SUM_OF_Length_field into the near table.

Finally you can use Frequency on the IN_FID field of the near table with a SUM of the field that carries the sum_of_length values.

I didn't have time to test this all the way. Hope it works for you or gives you some lead.

Regards,
0 Kudos
pernilleparmer
Emerging Contributor
If you have the ArcInfo license, you can try the Generate Near Table tool:
- Specify a small search distance (e.g. 1 meter/feet) if you are only interested polygons that share boundary with the central polygon. All the neighboring polygons should get 0 for NEAR_DIST.
- Uncheck "Find only closest feature (optional)", so that you are not only getting one of the neighbors.

Then you use the Join Field tool to join the near table by the NEAR_FID field with your polygon feature class by the FID field to get the SUM_OF_Length_field into the near table.

Finally you can use Frequency on the IN_FID field of the near table with a SUM of the field that carries the sum_of_length values.

I didn't have time to test this all the way. Hope it works for you or gives you some lead.

Regards,




Thanks Dan.

It worked well=) I'm glad, I do not know any Python. The Generate near table used some hours (and I do not understand why) do calculate neighboring polygons, so i downloaded this instead: Find Adjacent & Neighboring Polygons. This also worked well.

Thanks again.

Regards Pernille
0 Kudos
pernilleparmer
Emerging Contributor
Hope you know some Python.

There are a few ways of determning adjacency in ArcGIS that I use:

1. Use a SelectByLocation to select polygons that touch/intersecct/share line segment with/etc.
2. Use the PolygonToLine tool. The output lines will have fields indicating the OBJECTID of the polygon to the right and left of the arc... I mean line (just like a good ole' coverage .aat)!


Thanks for your response. I do not know any Python so I tried Dan's suggestion. But thanks any how=)
0 Kudos
NobbirAhmed
Esri Regular Contributor

... The Generate near table used some hours (and I do not understand why) do calculate neighboring polygons,


Hi Parmer, I would like to investigate the slow-ness of Generate Near Table - could you tell me the version of ArcGIS you are working with?

Nobbir Ahmed
ESRI Geoprocessing Team
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Hi Pernille,

Thanks for testing my idea and confirming it works well.

The slowness of Generate Near Table may depend on how many neighbors each of the polygons has and how complex of the shapes are; but hours do sound too long. If you like, please pass the data to me by email:  dlee@esri.com and I will forward it to my colleague Nobbir for investigation.

Thanks,
0 Kudos
ChrisSnyder
Honored Contributor
I do not know any Python so I tried Dan's suggestion. But thanks any how=)


Bummer... The line/poly relationships calculated with the PolygonToLine tool are both fast to  and give you a lot of pertinent info (such as how long the shared borders are). Downside is that you would need to run things in a cursor and loop to do what you are trying to do.
0 Kudos
pernilleparmer
Emerging Contributor
Hi Parmer, I would like to investigate the slow-ness of Generate Near Table - could you tell me the version of ArcGIS you are working with?

Nobbir Ahmed
ESRI Geoprocessing Team


Dear Nobbir,

I apologize my LATE response. I used version 10.0. I guess you do not need it now...

Best,
Pernille
0 Kudos
NobbirAhmed
Esri Regular Contributor
I guess you do not need it now.


Thanks for getting back. If you can provide me the data that would be great. We are still working on to improve the performance of proximity calculations.
0 Kudos