Skip to content

union method result is wrong #3033

Description

@youngs-github

this case return MultiPolygon by @turf/turn@7.1.0~7.3.0,actually [117.391957,31.885292] is same,and [117.3985747814587,31.88063768247069] is in poly2

poly1:[[117.391957,31.885292],[117.394052,31.883763],[117.3985747814587,31.88063768247069],[117.391957,31.885292]]

poly2:[[117.398735,31.880525],[117.391957,31.885292],[117.386983,31.885557],[117.380446,31.885525],[117.373772,31.886428],[117.367324,31.887112],[117.3691905,31.8881706],[117.3692101,31.88819],[117.3743513,31.890005],[117.3782127,31.8906978],[117.3834385,31.891254],[117.3834486,31.8912438],[117.3834549,31.8912559],[117.3836101,31.8912636],[117.3836258,31.8912656],[117.3987235,31.881117],[117.3987237,31.8811043],[117.398735,31.880525]]

you can try
union(featureCollection([turfPolygon([poly1]), turfPolygon([poly2])]))

while polygon-clipping could

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions