Skip to content

Difference: Polygons exterior ring has a wrong position. #91

@ilijaz

Description

@ilijaz

After running intersection operation, result has had a negative area -9069.92444862902 which was calculated with turf.area. If you look at the result polygon you can see that second Polygon in MultiPolygon has the wrong position of the exterior ring.
https://codepen.io/ilijaz/pen/NLwvxN

turf.area(turf.polygon([inter.geometry.coordinates[1][0]]))
1023.8113326824149
turf.area(turf.polygon([inter.geometry.coordinates[1][1]]))
8.098257462853686
turf.area(turf.polygon([inter.geometry.coordinates[1][2]]))
9603.9065415225

So the standart says:

For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.

Is it possible to sort rings in polygon after clipping?

PS. All works fine with QGIS and Leaflet.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions