
Do you have a short draft how you want to detect that two areas are touching? When two nodes follwing each other from one polygon are inside the other. Or on the outline of it.
Yeah, and you will have to test some 100 thousands of nodes, if they lie inside one of a 10 thousands polygons. This will be as a number of thumb 10 ^ 9 tests (or add some more zeroes) of tests if the is node in polygon area, which is not a cheap test by itself. You will need at least some tricks with quadtrees or bounding box checks to achieve reasonable runtimes. In general I really like the idea of merging polygon areas. I have mentioned it already in this mailing list. But up to now I haven't found any practicable solution. The algorithm should merge two polygons even if there is some space between it. Think of a map of small woods or lakes, which should be combined to a bigger one and simplified, while zooming out of the map. They are *not* overlapping or touching in most of the cases. I don't want discourage you, if you think, you have some working solution, please let us know. Regards, Johann