problems with DISSOLVE function when aggregating NEIGHBOUR POLYGONS

3448
14
Jump to solution
09-18-2013 01:01 PM
by Anonymous User
Not applicable
Original User: ElenaLZ

Hello everyone,

I have problems with the dissolve function.

I have a shapefile with multiple polygons, some are together and some are not. I want to use the dissolve function to create a new polygon shapefile where all adjacent polygons are aggregated into bigger polygons.

When I use the dissolve function it doesn't dissolve those polygons that only share a point with their neighbours.

A portion of my shapefile before the dissolve:
[ATTACH=CONFIG]27560[/ATTACH]

and after the dissolve
[ATTACH=CONFIG]27561[/ATTACH]

I think that the dissolve function doesn't understand that these polygons are also neighbours and, so, it creates two different polygons. Is there a way I can tell the dissolve function that those polygons are also neighbours?

Any help will be much appreciated.

Thank you.
0 Kudos
1 Solution

Accepted Solutions
ElenaLopez
New Contributor III
Hi everyone,

I have found the solution, and here are the steps I have followed:

0. Original Data: a shapefile with polygons (data.shp)

1. Create a BUFFER of small distance (name of the new shapefile: data_buffer.shp)
2. DISSOLVE the new shapefile (unchecked create multipart features) (name of the new shapefile: data_buffer_dissolve.shp)
3. Use the INTERSECT tool: intersect data.shp + data_buffer_dissolve.shp (name of the new shapefile: data_buffer_dissolve_intersect.shp)
4. DISSOLVE data_buffer_dissolve_intersect.shp. The dissolve field is the FID of data_buffer_dissolve.shp and this time you do checked create multipart features. Name of the final shapefile (data_def.shp)

Thanks rfairhur24 for suggesting using buffers to solve the problems !!

View solution in original post

0 Kudos
14 Replies
ShikoNjuno
Occasional Contributor
Do you happen to have a field that they have in common?
I don't know how you are currently letting the tool know which is a neighbor (and which is not), but I'm pretty sure it's looking for a common field that it can base the dissolve off of.
0 Kudos
by Anonymous User
Not applicable
Original User: rfairhur24

Hello everyone,

I have problems with the dissolve function.

I have a shapefile with multiple polygons, some are together and some are not. I want to use the dissolve function to create a new polygon shapefile where all adjacent polygons are aggregated into bigger polygons.

When I use the dissolve function it doesn't dissolve those polygons that only share a point with their neighbours.

A portion of my shapefile before the dissolve:
[ATTACH=CONFIG]27560[/ATTACH]

and after the dissolve
[ATTACH=CONFIG]27561[/ATTACH]

I think that the dissolve function doesn't understand that these polygons are also neighbours and, so, it creates two different polygons. Is there a way I can tell the dissolve function that those polygons are also neighbours?

Any help will be much appreciated.

Thank you.


What is the "Dissolve function"?  Are you using the Dissolve tool?  If so, are you checking the create multi-part option?  What attributes are you using for the case fields, if any?

Your illustration does not make clear what your problem is.  I would want the 2 polygon result you showed, since the attributes indicated (1,and 2) should not dissolve together regardless of whether or not they touch.  If those numbers have nothing to do with the dissolve settings than they only confuse the issue.

Basically you cannot get what you want with a single dissolve if you have both touching and non-touching polygons that you want to keep separate at the end.  The multi-part option will make one feature whether or not the original polygons touch, and the single part option will never make polygons join together that touch at just a corner point.

So don't start with a Dissolve.  Start with the Buffer tool using an very small buffer to get what you consider to be touching to actually join together first (the buffer will make the touching point a touching polygon).  Make the Buffer tool do a dissolve on the attribute you will ultimately use in the Dissolve at the end.

Then do a Spatial Join with the original polygons as the target and the Buffer polygons as the join features and use the One to Many option and keep all fields.

Select all features that match on your dissolve attribute from the case field(s).

Dissolve on the selection and include the JOIN_FID value derived from the Buffer as part of the dissolve case fields and the multi-part option.  The corner touching polygons will now be joined together, but not polygons with no touching points in common, because the non-touching polygons will have different buffer IDs.
0 Kudos
ElenaLopez
New Contributor III
Thanks Shiko.

I have a shapefile with more than 30000 polygons, so I'm trying to find a way to do it automatically and not manually.

I could do it manually but I have to repeat the process several times (I have 100 different shapefiles), so, it could be great if I find a way to solve that.

The dissolve field is optional, and if you don't specify any, then it dissolves the adjacent polygons into bigger ones (just whay I want BUT it doesn't consider as a neighbour the polygons that only share a point with the other ones).

Any additional idea ?

Thank you.
0 Kudos
by Anonymous User
Not applicable
Original User: TKONG

Hello everyone,

I have problems with the dissolve function.

I have a shapefile with multiple polygons, some are together and some are not. I want to use the dissolve function to create a new polygon shapefile where all adjacent polygons are aggregated into bigger polygons.

...
I think that the dissolve function doesn't understand that these polygons are also neighbours and, so, it creates two different polygons. Is there a way I can tell the dissolve function that those polygons are also neighbours?

Any help will be much appreciated.

Thank you.


The Dissolve tool doesn't have more choices to indentify the neighbours, but the Aggregation tool can - just set up the distance between features is greater that feature class tolerance setting value.
0 Kudos
ElenaLopez
New Contributor III
That was a good idea, but I don't know why it doesn't perform well. It keeps on creating two different polygons.

The weird thing is that when I calculate the distance to nearest polygon (Genereate Near Table Tool) you see that the distance between both polygons are 0 meters. Why does this happen ?? I mean ... if the distance between both polygons are 0m and I use the aggregation tool with an aggregation distance of 100m why it doesn't aggregate both polygons ??

Any idea ??
0 Kudos
by Anonymous User
Not applicable
Original User: TKONG

That was a good idea, but I don't know why it doesn't perform well. It keeps on creating two different polygons.

The weird thing is that when I calculate the distance to nearest polygon (Genereate Near Table Tool) you see that the distance between both polygons are 0 meters. Why does this happen ?? I mean ... if the distance between both polygons are 0m and I use the aggregation tool with an aggregation distance of 100m why it doesn't aggregate both polygons ??

Any idea ??


I had a chance to use Aggregation Tool to merge the polygons that distance is 0 (share one point) and it worked well.
0 Kudos
ElenaLopez
New Contributor III
What is the name of the tool you are using ?? I'm using ArcGis 10 and the tool is called Aggregate Polygons. Is it the same one as yours ??
0 Kudos
by Anonymous User
Not applicable
Original User: rfairhur24

What is the name of the tool you are using ?? I'm using ArcGis 10 and the tool is called Aggregate Polygons. Is it the same one as yours ??


There is a tool called Dissolve and the Aggregate Polygons tool technically is not the Dissolve function.  In any case, the Dissolve tool is the commonly used tool available for all license levels and the Aggregate Polygon tool is only available with an Advanced license, so I did not consider it likely to be the one you were using.

The Aggregate Polygons Tool is slow and cannot use a case field to separate polygons based on attributes, so it has to be iterated to deal with attribute based aggregations (it also crashes ArcMap after about 600 iterations).  The Buffer Tool, Spatial Join Tool and Dissolve Tool are all very fast and observe case field attribute distinctions when creating shapes, so they can process everything in a single step and those are the tools I would use, especially since you do not seem to be eliminating enclosed holes in your output.

For the Buffer I forgot to mention that after you created the buffers using the List option, you would then need to process that result through the Multipart to Singlepart Tool to separate non-touching buffers with the same attributes before applying the Spatial Join tool.

The Aggregate Polygons tool creates single part polygons.  To be a single part, a polygon can only have one contiguous enclosed area.  It is impossible to have area cross through just a single point, so to maintain single part polygons, two polygons have to be created.  With the Dissolve tool you have the option of specifying if you want singlepart or multipart features, but it follows the same rule for single part polygons.  So my method tricks ArcMap into creating a hybrid multipart polygon that requires that the polygons must at least touch at a point, which normally is not required by multipart features.
0 Kudos
RichardFairhurst
MVP Honored Contributor
Here is the model I ran and a test set of data.  The screenshots got a little out of order.  The first screenshot is the model.  The third screenshot shows the input polygons (CornerTouch layer shown).  The second screenshot shows the 1 foot buffer distance output which creates a single shape (MapBuffer layer shown).  Then after using the multipart to single part tool and the Spatial Join tool (MapBuffer2 layer and MapParcels layers respectively, not shown) I used the Dissolve tool (4th screenshot with MapDissolve layer shown) to achieve the final result.

The central green polygon in the MapDissolve layer is one multipart polygon feature that contains 3 polygon parts that only touch each other at a single point.  The other two shapes are separate single part polygon features because they do not touch any other polygon at even a point.  The final output has no buffer, so it is a pure dissolve of the original input shapes.
0 Kudos