Open cavasinf opened 3 years ago
@return {boolean} whether the point is in the polygon (not on the edge, just turn < into <= and > into >= for that)
Even with that, if I apply this logic it only reverse my case above :
I think I may have solved this in the Python implementation of the algorithm. There is a singularity in the original condition which may be responsible for this. I already created a pull request for it. If you want to check if a point is on the edge, I would check this separately. You can check out my polygon module in my repositories, I have a function for that.
Hi, I'm using your code of Point in Polygon in JS.
But it seems to not work in every case.
I'm currently using leaflet, and with your code I want to know if my point is IN a polygon. It works like a charm when the point is inside or in the bottom edge or in left edge.
✔️ ✔️ ✔️
But not when it's inside the top or right edge.
❌ ❌
It's maybe due to the fact that we need the "line" from the point to cross the edge, and not being on it.