2

I have a polygon that looks like this:

enter image description here

I want to get a result that ideally looks like this:

enter image description here

The best that I can come up with is a polygon simplification using shapely in Python:

enter image description here

Which algorithm could deal with this problem?

The polygon files are here.

5
  • 4
    Could you share the polygon geometry (WKT string, for instance)? It is hard to make one like that to work on it. Commented Apr 3, 2023 at 7:28
  • added link to repo with files Commented Apr 3, 2023 at 7:38
  • 3
    You could rasterize the polygon onto a coarse grid. That would help create the linearity you seem to want. Then you could smooth that grid with morphological operators (e.g. erode/dilate). I don't have time to implement it and not sure it'd get you what you want. (BTW there's a hole in your brown polygon on the right-most finger that shouldn't be there?)
    – Jon
    Commented Apr 3, 2023 at 7:39
  • no, the hole is not nesessary right now. Thanks, I'll try now Commented Apr 3, 2023 at 7:44
  • 2
    ArcGIS "Simplify Building" generates similar output that you desire. I couldn't find a solution in QGIS years ago. So I had to use the tool in ArcGIS. -> i.sstatic.net/ocqEG.png Commented Apr 3, 2023 at 7:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.