Turfjs / turf

A modular geospatial engine written in JavaScript and TypeScript

Home Page:https://turfjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

intersect throws an error when given adjoining polygons

stevage opened this issue · comments

turf 6.5.0

const a = {
    "type": "Feature",
    "properties": {
    },
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    115.999199283951,
                    -31.87109214935888
                ],
                [
                    115.999073681861,
                    -31.87117439325889
                ],
                [
                    115.9992940352709,
                    -31.87151111002888
                ],
                [
                    115.999419676221,
                    -31.87142887635887
                ],
                [
                    115.999199283951,
                    -31.87109214935888
                ]
            ]
        ]
    }
}


const b = {
    "type": "Feature",
    "properties": {
    },
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    115.9994196762208,
                    -31.87142887635886
                ],
                [
                    115.9995451833009,
                    -31.87134673031883
                ],
                [
                    115.999324774701,
                    -31.8710099783589
                ],
                [
                    115.999199283951,
                    -31.87109214935887
                ],
                [
                    115.9994196762208,
                    -31.87142887635886
                ]
            ]
        ]
    }
}

turf.intersect(a,b);
// Uncaught Error: Unable to complete output ring starting at [115.999199283951, -31.87109214935888]. Last matching segment found ends at [115.99941967622092, -31.87142887635877].