Skip to content

Fixing self-intersections in rings #409

@funchal

Description

@funchal

I have a set of unoriented rings, possibly (self-)intersecting, and I want to construct a multi_polygon from them, by just simply assuming that:

  • each outer ring is a polygon.
  • a ring inside of another is a hole.
  • a ring inside of a hole is another polygon, etc...

I figured that, if I can convert each ring on its own to a polygon, then sym_difference should resolve intersections nicely, and give me what I want. However, sym_difference can't work with self-intersecting rings (assertion hit), so I am trying to figure out the easiest way to fix the self-intersections first.

I think the best way to handle self-intersections in my case is to split the rings, so looking around I found split_rings.hpp. However:

  • this line seems to have a bug since detail::overlay::turn_operation is used without its template parameters.
  • also, I understand that code is an extension, so I am asking whether there are any better/easier ways to deal with this problem. I have considered using self_turns directly.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions