There is often a need to merge all the intersecting Polygon into one.
No available tools are found in arctoolbox. (Merge, union is not this function. Dissolve is a combination of attributes.
So I want to use dissolve.
Set a field to be merged and take the same value.
This setting is similar to the connected component of graph theory. The equivalence class is divided on the set.
Remember that in data structure, the construction of equivalence classes is implemented using binary trees.
However, in. net, there are statck and queue, and there is no tree data structure (of course there is Treeview UI ).
So on codeplex, find the tree and find a datastruct class library. (How nice it would be to have a classic perfect datastruct !)
It implements binarytree, searchtree, and black-red tree. All are generic-based.
Try again. But I always feel that this open-source project is not mature enough to be used.
After dinner, lie in bed and think about this problem.
I want to use a set to solve the problem. But it's not elegant: Chaos!
Later I thought of my ownCodeAnd use arrays to divide equivalence classes.
There is no doubt about the Array Performance.
In addition, the space complexity is the smallest, and of course the time complexity is high.
HoweverProgramSimple Design and time complexity can be compensated by the performance of the array.
Finally, an array is used as the temporary data structure to query the spatial relationship of elements one by one. If the array values are the same, they are intersecting (undirected ), belongs to the same equivalence class and should be merged.
With the equivalence class, it is easy to directly use geoprocessor + dissolve.