I have an input, a set of different types of 2D geometrical elements with all its attributes (arcs, circles, lines, polylines, rectangles, polygons..). These elements can be connected end to end, overlapping, intersecting.

I want to extract all possible polygons formed from this set of elements, including the outermost polygons which can be a superset of inner polygons. (I need to integrate this in a C# .Net application, where I will extract all polygons and be able to give Color-Fill to any of those polygons)

enter image description here

I need to extract all the inner (green) and outer(red) polygons.

I would like to know if there is an existing implementation available for this. Or if any combination of existing solutions would provide a required output.

If there are no solutions available, how could I develop a solution?

  • 1
    Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works
    – Ian Turton
    Jul 8 at 7:56

For a conceptual solution using QGIS, you can use the following procedure:

  1. Dissolve all polygons

  2. Convert polygons to lines

  3. Use Split with lines: split polygons from step 1 with lines from step 2.

left:before ; right: after enter image description here

  • 1
    @Taras - I deleted your edit: it looks much better in most cases. However, on some mobile devices, it will not, see: i.stack.imgur.com/Oi2wd.png
    – Babel
    Jul 11 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.