You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: This test data is "polygon" type data with holes (i.e. there is an inner ring). If you use the "booleanPointInPolygon" function to determine whether a point is within the data area, it will appear that when the point is in the inner ring, it will still return true, actually want to return false.
Code
var polygon = turf.polygon(([data.geometries[0].coordinates[0]])); // Load uploaded test data
var point = turf.point([119, 10]);
let bool = turf.booleanPointInPolygon(point, polygon);
The text was updated successfully, but these errors were encountered:
Hi @yahabibib. I think Turf's booleanPointWithinPolygon has some bugs. Found a comment on a similar issue, that includes a library that might give you a correct result. Not ideal, however should let you proceed until we can fix our implementation.
Let us know if that helps! Btw, even if the other library fixes your problem, please leave this issue open until Turf's implementation is fixed. We can use your test data to validate any PRs.
var point = turf.point([119, 10]);
let bool = turf.booleanPointInPolygon(point, polygon);
The text was updated successfully, but these errors were encountered: