Skip to content

Commit

Permalink
Merge pull request #2563 from superDoss/fix_booleanvalid_polygon
Browse files Browse the repository at this point in the history
[@turf/boolean-valid] fix #checkClosingRing to check for polygon being closed
  • Loading branch information
mfedderly authored Aug 5, 2024
2 parents e3fb086 + 6fb4e23 commit cc680d3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/turf-boolean-valid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function booleanValid(feature: Feature<any> | Geometry) {

function checkRingsClose(geom: Position[]) {
return (
geom[0][0] === geom[geom.length - 1][0] ||
geom[0][0] === geom[geom.length - 1][0] &&
geom[0][1] === geom[geom.length - 1][1]
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-0.703125, 24.84656534821976],
[11.25, 24.84656534821976],
[11.25, 31.353636941500987],
[-0.703125, 31.353636941500987]
]
]
}
}
]
}

0 comments on commit cc680d3

Please sign in to comment.