turf
turf copied to clipboard
booleanContains problem in isLineInPoly
Example data & snippet:
Poly.geojson Linestring.geojson
Even though linestring is not completely contained by polygon, booleanContains function returns true.
It looks like isLineInPoly function only tests midpoints of line segments,
Did I miss something ?
Hey @ubaltaci looks like you're right. Strange enough a simple test like this is actually missing in the package. Thanks for the heads-up.
I just ran into this issue. It's not only just testing midpoints that is a problem, but also if ANY of the mid points are within the polygon isLineInPoly returns true.
this is affecting us too. Any chance we can get a fix before v7?
the light-blue and black lines are getting a true from booleanContains in v6.3.0
https://jsfiddle.net/abdulmalik07/pbcyzg6j/26/