Skip to content

Issue with clipping on coverage-like polygons #337

@asinghvi17

Description

@asinghvi17

When performing clipping on coverages, you often run into a situation where a polygon is fully enclosed by the coverage, but there is one point at which there are two outer polygon points and one inner polygon point. Here's what I mean:

Image
import GeometryOps as GO, GeoInterface as GI

outer = GI.Polygon([GI.LinearRing(Tuple{Float64, Float64}[
    (0, 0),
    (1, 0),
    (1, 0.5),
    (0.5, 0.1),
    (0.1, 0.5),
    (0.5, 0.9),
    (1, 0.5),
    (1, 1),
    (0, 1),
    (0, 0)
])])

inner = GI.Polygon([GI.LinearRing(Tuple{Float64, Float64}[
    (1, 0.5),
    (0.5, 0.1),
    (0.1, 0.5),
    (0.5, 0.9),
    (1, 0.5),
])])

Now if you try to union, intersection or difference these, strange things happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclippingAbout polygon clipping or processing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions