Skip to content

intersection of polygon with hole results in the hole flipping orientation and causing self-intersection #128

@mglasgow

Description

@mglasgow

I have found another edge case while dividing up OpenStreetMap country boundaries into QuadTiles.

I have attached the geojson in the "genericTestCase" format that @bluenote10 put together.

I am intersecting a polygon of Spain's border, which has an enclave cut out for Gibraltar, with a square tile. The Gibraltar hole is completely contained within the square tile, so should be a straight forward intersection.

This is what I expect:
expected result

This is what I get. Note the internal hole is coloured red, as it is now a part of the multipolygon

actual result

Here are is the generic test case geojson:

issue128.geojson.txt

And here is the actual geojson result I get from the intersection:

actual-output.geojson.txt

Perhaps the winding order of the interior ring is reversing?

I am using the master branch of this repo, and I have also applied the #125 pull request too.

@bluenote10 If you get a chance, would you mind running this through your Rust implementation to see how it handles it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions