Relative Content

Tag Archive for pythongeospatialgeopandasgdalfiona

Dissolving polygons in python results in some polygons missing

I have a large code that is essentially vectorizing a tiff layer into polygon shapefile. the last step of the code is dissolving the polygons based on their value (ranging 1-5). I tried using ‘Geopandas’s ‘dissolve’, ‘Shapely’ and ‘Fiona’s ‘unary_union’ function, I tried ‘GDAl’s ogr2ogr function and in all of them I get the same issue.
Some of the lower level polygons are being ‘Swallowed’ by the higher levels. for some reason, in some areas the polygons change their borders and go over the lower levels. this means that in the final output I’m missing some of the poylgons.
The same effect happens when I use the dissolve tool in ArcMap, BUT the same tool in Qgis works perfectly and does not cause this issues.