Dissolve all adjacent pairs of polygons in a shapefile?

5162
8
07-13-2011 05:31 AM
SrikanthSivashankaran
New Contributor
Hello,

My apologies in advance if I get the terminology wrong or am asking a really dumb question - am learning arcgis for a class.

I have a census boundary file of school districts in a state.  I'm looking for a way to dissolve or merge all adjacent pairs of polygons in this shapefile - I am interested in the shape of every hypothetical merger of two districts. 

I was able to use cmaene's "Find Adjacent and Neighboring Polygons" tool http://resources.arcgis.com/gallery/file/Geoprocessing-Model-and-Script-Tool-Gallery/details?entryID... to generate a csv with a record for each shape ID and fields for the shape ID of every adjacent polygon. 

EDIT: I should probably make it clear that since there are many, many different ways to group the layer of school districts into pairs of adjacent polygons, I don't think the output for this project could be in a single layer, but I don't know what other formats are possible. 

How might I approach this problem? Do I need to learn some scripting?

Thanks in advance for any help you can provide.
0 Kudos
8 Replies
LornaMurison
Occasional Contributor
It sounds like the "dissolve" tool will do what you want.  If you don't specify any fields it will dissolve all touching polygons.
If you want to specify which polygons get joined to which other polygons you can add a field with a simple numeric code.  Give each polygon the code of the "new polygon" you want it to belong to and then use this field when you run the "dissolve" tool.
0 Kudos
SrikanthSivashankaran
New Contributor

If you want to specify which polygons get joined to which other polygons you can add a field with a simple numeric code.  Give each polygon the code of the "new polygon" you want it to belong to and then use this field when you run the "dissolve" tool.


I like this idea but I'm concerned about how to scale the process up to the number of adjacent polygon pairs I have to deal with.  I'd estimate that there are about 600 polygons in the shapefile and of course at least that many pairs of adjacent polygons.  I would be overjoyed if there were a way to automate this process .... Otherwise I can get started on putting together a dissolve table in Excel ! 😃
0 Kudos
LornaMurison
Occasional Contributor
I'm not sure I understand what the data you are dealing with are like.  How are you hoping to decide which polygons get merged together?  Could you perhaps post a screenshot of what the data look like?
Thanks!
0 Kudos
SrikanthSivashankaran
New Contributor
I'm not sure I understand what the data you are dealing with are like.  How are you hoping to decide which polygons get merged together?  Could you perhaps post a screenshot of what the data look like?
Thanks!


Hi Lady_Jane,

Thanks in advance for your help.  The map here:

http://blog.cleveland.com/datacentral/2008/08/Ohio-Schoo-Report-Card-2008-plain-dealer.gif

is kind of what I'm working with - all the school districts that are polygons in my data are marked off with faint lines.  (The thicker boundaries are county boundaries, which I'm not concerned about).  I want to take every adjacent pair and create a shapefile(s) with joint districts.

I hope that clarifies things.  Please let me know if there's any other detail that would help, and thanks again.
0 Kudos
LornaMurison
Occasional Contributor
Every district is surrounded by other districts, there must be thousands of possible combinations of merging two adjacent districts.  Did you want to create a different shapefile to represent each possible combination of merges?
0 Kudos
SrikanthSivashankaran
New Contributor
If possible, I would like to create a different shapefile to represent each possible combination of merges.  Since yesterday I exported my attribute table to Excel and have been creating several dissolve fields from the list of adjacent feature IDs.

E.g., if the data looks like

FID1 - FID2
0 - 1
1 - 2
2 - 4
5 - 4
3 - 6
7 - 6
(+ a couple thousand rows)

I have a "dissolve_a" table that takes all the first appearances of each FID:

FID - diss_a
0 - A
1 - A
2 - B
4 - B
3 - C
6 - C

And a "dissolve_b" table that resolves all the first appearances of each FID after the FIDs for "dissolve_a" are removed:

FID - diss_b
1 - A
2 - A
5 - B
4 - B
7 - C
6 - C

And many additional "dissolve_" tables resolving the subsequent appearances of each FID.  And you're right, there are many thousands of combinations!

Eventually I think I'll join each of the dissolve tables to the original shapefile, and then dissolve on each of the joined fields, creating several shapefiles of paired-off polygons.  Unless there's something I'm missing? An easier way to do it?
0 Kudos
LornaMurison
Occasional Contributor
Well you seem to have a handle on it...  I can't really think of an easy way to do it, sounds like a statistician might have more luck :).
0 Kudos
KimOllivier
Occasional Contributor III
If you create centroid labels for the polygons and then create a TIN from the points you can use the from-to of the lines to get a list of adjacent polygons. That may make it easier to dissolve pairs of polygons. Note that you can dissolve all the pairs in a single process.
0 Kudos