I have a shapefile with thousands of polygons and would like to merge (join) adjacent polygons based on a threshold between attributes. I need to use python because I'm not allowed to use ArcGIS.
e.g., my attribute is "height", if the polygons touch each other and their height difference if lower than 2 metres, they should be merged (the height values are not the same).
I'm trying to use itertools.combination to work with two polygons of the same shapefile, but if I merge them in a new one, the next comparison need to be with this merged one and the newer one.
Can anybody help me?