Want to dissolve adjacent polygons but no common edges.

3289
16
Jump to solution
05-08-2013 11:52 AM
HaoLiu1
New Contributor
I have a bunch of parcel data, I want to join the polygons basing on the same owner name.
Even they are not touched, I want merge them together, such a 100 feet tolerance. The purpose is to show the somebody's properties without too much separated lines.
Like this
[ATTACH=CONFIG]24136[/ATTACH]
I have some programming experience, but just start to try to get the tool by python script, and tried arcgis add_in wizard.
If there is some idea about the script work flow, it will be really helpful!
0 Kudos
1 Solution

Accepted Solutions
RichardFairhurst
MVP Honored Contributor
I am just trying it in ArcMap now. Couple of questions. Thanks.
As the sample layer, I have 16 polygons[ATTACH=CONFIG]24172[/ATTACH], then the result of the step 3 spatial join has 63[ATTACH=CONFIG]24173[/ATTACH]
For step 4, I found every polygons in the result match the condition "where the Owner name of the original polygon is the same as the owner name of the dissolved polygon"[ATTACH=CONFIG]24174[/ATTACH]Then, follow your step, this is the final result[ATTACH=CONFIG]24175[/ATTACH]The selected are only one feature, but I don't want the gap between them. Is there any steps I went wrong? I really appreciate your help!


You did nothing wrong.  That is the result I was instructing you to achieve.  I did not realize you wanted the gap to be filled, since I thought you wanted the output to look like the picture you first attached.  To do that you would not do the steps I listed previously.

The only tool that does what you want is the Aggregate Polygons tool, but you have to have ArcGIS 10.1 and an Advanced license to use that tool.  Additionally that tool does not respect attributes, it simply fills in the gap of every polygon it is given within the buffer tolerance specified.  So to use that tool you have to create an iterator to select each set of polygons with the same owner name, run the Aggregate tool, calculate the owner name into the output, and then append each output together to get a feature class of all names.  The iterator will crash after about 2,000 iterations, so if that happens you have to use definition queries to filter to greater than the last owner that was appended and restart the tool.  A summary of the tool steps you would have to use and a picture of an example model layout is attached.

The tools are:
1. Create a variable called String that is defined as "%Value%" (the current iterator value)
2. Create an Iterator on your owner name field. (You would first have to concatenate all names into a single field if there are multiple fields used to store the full owner name).
3. Aggregate Polygons tool.  Use the orthogonal option for parcels.
4. Add the owner name field to the Aggregate Polygon output
5. Make Feature Layer
6. Calculate field using %String% as the expression (the current iterator owner name value formatted as a String).
7. Append to a feature class that just has the polygon shape type and the same spatial reference and owner name field as the output of step 4.

The tool has a problem with bezier curves, so some simplification to line segments will be required if you have that type of geometry.  It also takes approximately 10 seconds per parcel set, so it is a slow process compared to tools like dissolve.

View solution in original post

0 Kudos
16 Replies
HaoLiu1
New Contributor
Or is there anyway that I can view the source code of dissolve or merge process tool?
0 Kudos
RichardFairhurst
MVP Honored Contributor
Or is there anyway that I can view the source code of dissolve or merge process tool?


There is no need to use any scripting.  You can do this with the basic geoprocessing tools and a simple ModelBuilder model that chains the tools together.

1.  Use the buffer tool to make your parcels have a 100 feet buffer around them. 
2.  Dissolve the buffered output on owner name with the option that makes single part polygons.
3.  Use the Spatial Join Tool on the original parcels and the Buffered and Dissolved output using the One to Many option (make sure the original parcels are the primary input and the Dissolved polygons are the sencondary input).
4.  Select all the results of the Spatial Join where the Owner name of the original polygon is the same as the owner name of the dissolved polygon.
5.  Dissolve the Spatial Join output selection using the Owner Name together with the FID of the dissolved polygon and use the multi-part option.

The final dissolve will have all parcels with the same owner name that are within 100 feet of each other dissolved using the original parcel boundaries.  Multiple polygons for the same owner name will exist in the output if there were multiple areas that did not dissolve together when the buffer was applied.
0 Kudos
HaoLiu1
New Contributor
There is no need to use any scripting.  You can do this with the basic geoprocessing tools and a simple ModelBuilder model that chains the tools together.

1.  Use the buffer tool to make your parcels have a 100 feet buffer around them. 
2.  Dissolve the buffered output on owner name with the option that makes single part polygons.
3.  Use the Spatial Join Tool on the original parcels and the Buffered and Dissolved output using the One to Many option (make sure the original parcels are the primary input and the Dissolved polygons are the sencondary input).
4.  Select all the results of the Spatial Join where the Owner name of the original polygon is the same as the owner name of the dissolved polygon.
5.  Dissolve the Spatial Join output selection using the Owner Name together with the FID of the dissolved polygon and use the multi-part option.

The final dissolve will have all parcels with the same owner name that are within 100 feet of each other dissolved using the original parcel boundaries.  Multiple polygons for the same owner name will exist in the output if there were multiple areas that did not dissolve together when the buffer was applied.


It is a huge opportunity for me to practice my English, especially the 4th steps and the last sentence, no kidding.
I am still trying it! Thank you very much!
0 Kudos
RichardFairhurst
MVP Honored Contributor
It is a huge opportunity for me to practice my English, especially the 4th steps and the last sentence, no kidding.
I am still trying it! Thank you very much!


One note about step 4 and ModelBuilder.  The Spatial Join tool output in step 3 results in a feature class, not a feature layer.  You would first need to apply the Make Feature Layer tool on the Spatial Join output to create a layer prior to using the Select By Attribute tool described in step 4 to get the selection of matched owner names.  If you did it live in ArcMap, the layer would automatically have been created in your map if you said yes to the dialog that asks if you want the tool result added to your map, but that dialog does not happen within ModelBuilder.
0 Kudos
HaoLiu1
New Contributor
One note about step 4 and ModelBuilder.  The Spatial Join tool output in step 3 results in a feature class, not a feature layer.  You would first need to apply the Make Feature Layer tool on the Spatial Join output to create a layer prior to using the Select By Attribute tool described in step 4 to get the selection of matched owner names.  If you did it live in ArcMap, the layer would automatically have been created in your map if you said yes to the dialog that asks if you want the tool result added to your map, but that dialog does not happen within ModelBuilder.


I am just trying it in ArcMap now. Couple of questions. Thanks.
As the sample layer, I have 16 polygons[ATTACH=CONFIG]24172[/ATTACH], then the result of the step 3 spatial join has 63[ATTACH=CONFIG]24173[/ATTACH]
For step 4, I found every polygons in the result match the condition "where the Owner name of the original polygon is the same as the owner name of the dissolved polygon"[ATTACH=CONFIG]24174[/ATTACH]Then, follow your step, this is the final result[ATTACH=CONFIG]24175[/ATTACH]The selected are only one feature, but I don't want the gap between them. Is there any steps I went wrong? I really appreciate your help!
0 Kudos
RichardFairhurst
MVP Honored Contributor
I am just trying it in ArcMap now. Couple of questions. Thanks.
As the sample layer, I have 16 polygons[ATTACH=CONFIG]24172[/ATTACH], then the result of the step 3 spatial join has 63[ATTACH=CONFIG]24173[/ATTACH]
For step 4, I found every polygons in the result match the condition "where the Owner name of the original polygon is the same as the owner name of the dissolved polygon"[ATTACH=CONFIG]24174[/ATTACH]Then, follow your step, this is the final result[ATTACH=CONFIG]24175[/ATTACH]The selected are only one feature, but I don't want the gap between them. Is there any steps I went wrong? I really appreciate your help!


You did nothing wrong.  That is the result I was instructing you to achieve.  I did not realize you wanted the gap to be filled, since I thought you wanted the output to look like the picture you first attached.  To do that you would not do the steps I listed previously.

The only tool that does what you want is the Aggregate Polygons tool, but you have to have ArcGIS 10.1 and an Advanced license to use that tool.  Additionally that tool does not respect attributes, it simply fills in the gap of every polygon it is given within the buffer tolerance specified.  So to use that tool you have to create an iterator to select each set of polygons with the same owner name, run the Aggregate tool, calculate the owner name into the output, and then append each output together to get a feature class of all names.  The iterator will crash after about 2,000 iterations, so if that happens you have to use definition queries to filter to greater than the last owner that was appended and restart the tool.  A summary of the tool steps you would have to use and a picture of an example model layout is attached.

The tools are:
1. Create a variable called String that is defined as "%Value%" (the current iterator value)
2. Create an Iterator on your owner name field. (You would first have to concatenate all names into a single field if there are multiple fields used to store the full owner name).
3. Aggregate Polygons tool.  Use the orthogonal option for parcels.
4. Add the owner name field to the Aggregate Polygon output
5. Make Feature Layer
6. Calculate field using %String% as the expression (the current iterator owner name value formatted as a String).
7. Append to a feature class that just has the polygon shape type and the same spatial reference and owner name field as the output of step 4.

The tool has a problem with bezier curves, so some simplification to line segments will be required if you have that type of geometry.  It also takes approximately 10 seconds per parcel set, so it is a slow process compared to tools like dissolve.
0 Kudos
HaoLiu1
New Contributor
You did nothing wrong.  That is the result I was instructing you to achieve.  I did not realize you wanted the gap to be filled, since I thought you wanted the output to look like the picture you first attached.  To do that you would not do the steps I listed previously.

The only tool that does what you want is the Aggregate Polygons tool, but you have to have ArcGIS 10.1 and an Advanced license to use that tool.  Additionally that tool does not respect attributes, it simply fills in the gap of every polygon it is given within the buffer tolerance specified.  So to use that tool you have to create an iterator to select each set of polygons with the same owner name, run the Aggregate tool, calculate the owner name into the output, and then append each output together to get a feature class of all names.  The iterator will crash after about 2,000 iterations, so if that happens you have to use definition queries to filter to greater than the last owner that was appended and restart the tool.  A summary of the tool steps you would have to use and a picture of an example model layout is attached.

The tools are:
1. Create a variable called String that is defined as "%Value%" (the current iterator value)
2. Create an Iterator on your owner name field. (You would first have to concatenate all names into a single field if there are multiple fields used to store the full owner name).
3. Aggregate Polygons tool.  Use the orthogonal option for parcels.
4. Add the owner name field to the Aggregate Polygon output
5. Make Feature Layer
6. Calculate field using %String% as the expression (the current iterator owner name value formatted as a String).
7. Append to a feature class that just has the polygon shape type and the same spatial reference and owner name field as the output of step 4.

The tool has a problem with bezier curves, so some simplification to line segments will be required if you have that type of geometry.  It also takes approximately 10 seconds per parcel set, so it is a slow process compared to tools like dissolve.


I cannot view the attached image clearly~
And first problem, I cannot find the "value" data type in model builder variables, only an "any value", or "string"?
Awesome answer, it is my honor to get your helpful replies!
0 Kudos
RichardFairhurst
MVP Honored Contributor
I cannot view the attached image clearly~
And first problem, I cannot find the "value" data type in model builder variables, only an "any value", or "string"?
Awesome answer, it is my honor to get your helpful replies!


The tools shown are all listed in the summary, (String variable, an Iterator, and then the Aggregate Polygons, Add Field, Make Feature Layer, Calculate Field and Append tools).  The variable named String is a string variable that is set to equal "%Value%" (The quotes are required).  The quotes around %Value% in the variable String is important to make the Field Calculator treat it as a quoted string, and the calculation expression is %String% (unquoted).  %Value% is a built in variable that the iterator outputs (the light green-blue oval) and when it iterates your owner names the current owner name is what it will place within quotes in the Field Calculator when you reference the %String% variable.

The Blue input to the Append tool is the feature class that is a duplicate of the individual outputs where all features are appended together at the end.  My model also used the overwrite outputs option, so each iteration overwrites the file that will be appended with the next aggregated polygon set.
0 Kudos
RichardFairhurst
MVP Honored Contributor
Here are pictures showing a sample input and output of the model.  My model used 100 feet as the aggregation distance.
0 Kudos