point-in-polygon-hao
point-in-polygon-hao copied to clipboard
incorrect response for inside function
const coordinate = [
[51.65906944711844, 32.644344469605144],
[51.643474062027934, 32.64597280574026],
[51.6602114368668, 32.658994206590506],
[51.64382208072604, 32.65965256535195],
[51.65906944711844, 32.644344469605144],
];
const point = [51.6476999685446, 32.65383784687809]
const hao = inside(point, coordinate)
console.log(`hao gives: ${hao}`)
for this code, the function should returns true but it returns false! it means the response is incorrect. samely I have this bug when I use turf.booleanPointInPolygon do you have any suggestion for me? it is very important for me
Hi @Madanian
So it looks like the polygon you've provided contains self-intersections.
In theory this algorithm is supposed to work with those sorts of polygons but it doesn't appear to be working in this case - not sure why sorry.
Regards, Rowan