Skip to content

Intersection robustness failure #300

Closed

Description

@dbaston

An intersection operation with floating precision fails between the valid inputs below. Extracted from r-spatial/sf#794

Edit: removed WKT dump

Activity

  1. dbaston commented on Aug 21, 2018

    @dbaston
    ContributorAuthor

    Actually, here is an attached XML from TestBuilder. GitHub made me change the extension to .txt.
    300.txt

  2. dr-jts commented on Aug 22, 2018

    @dr-jts
    Contributor

    Those geometries are riddled with classic robustness-failure issues. Lots of nearly coincident points, and at least one place where the boundary of a geometry has a "narrow Z" pattern. So not surprising that they fail on overlay.

    Because of the linework pathologies (in particular the narrow Z), likely the snapping heuristic fails as well. And reducing precision is likely to introduce invalidity (i.e. due to the Z collapsing).

    As always, snap-rounding would probably solve these problems.

  3. dr-jts commented on Sep 21, 2019

    @dr-jts
    Contributor

    Update: snap-rounding overlay does allow this intersection operation to complete successfully.

    First, here's an image of the highly "unclean" linework on the border of the two input polygons (note: this is using the TestBuilder Reveal Topology mode - in actuality the gaps/overlaps are on the order of 1e-8 and hence almost invisible)

    image

    Executing the intersection using snap-rounding overlay with a grid size of 1e-5 gives the output shown below (black lines). The output is a MultiLineString (which contains gaps, as expected given the overlaps along the boundary).

    image

  4. gvsharma commented on Feb 2, 2023

    @gvsharma

    interesting , no response from anyone?

  5. dr-jts commented on Feb 2, 2023

    @dr-jts
    Contributor

    This was fixed by the introduction of OverlayNG in #599.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions