Skip to content

difference throws "Each LinearRing of a Polygon must have 4 or more Positions" with valid polygons #2160

@bhalderman-bv

Description

@bhalderman-bv

Running the below on turfjs.org/docs throws "Each LinearRing of a Polygon must have 4 or more Positions"
The polygons are valid on their own

turf.difference( 
    turf.polygon([[[-75.36578580737115,40.08918086136594],[-75.36576837301256,40.08918086136594],[-75.36576703190805,40.08918188736182],[-75.36576434969903,40.08918188736182],[-75.36576434969903,40.0891829133577],[-75.36576300859453,40.08918393935358],[-75.36576300859453,40.08918496534946],[-75.36576434969903,40.08918599134534],[-75.36576434969903,40.0891880433371],[-75.36576300859453,40.08918906933298],[-75.36576300859453,40.08919419931238],[-75.36576569080354,40.08919625130414],[-75.36576703190805,40.08919625130414],[-75.36576837301256,40.08919522530826],[-75.36577910184862,40.08919522530826],[-75.36578044295312,40.08919419931238],[-75.36578312516214,40.08919419931238],[-75.36578446626665,40.0891931733165],[-75.36578580737115,40.0891931733165],[-75.36578580737115,40.08918086136594]]]),
    turf.polygon([[[-75.3657858073712,40.0891808613659],[-75.3657683730126,40.0891808613659],[-75.365767031908,40.0891818873618],[-75.365764349699,40.0891818873618],[-75.365764349699,40.0891829133577],[-75.3657630085945,40.0891839393536],[-75.3657630085945,40.0891849653495],[-75.365764349699,40.0891859913453],[-75.365764349699,40.0891880433371],[-75.3657630085945,40.089189069333],[-75.3657630085945,40.0891941993124],[-75.3657656908035,40.0891962513041],[-75.365767031908,40.0891962513041],[-75.3657683730126,40.0891952253083],[-75.3657791018486,40.0891952253083],[-75.3657804429531,40.0891941993124],[-75.3657831251621,40.0891941993124],[-75.3657844662666,40.0891931733165],[-75.3657858073712,40.0891931733165],[-75.3657858073712,40.0891808613659]]])
)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions