I am trying bivrp::is_point_inside to check if a point is inside a square, but no matter what I try, I always get FALSE, even in the most obvious cases... What am I doing wrong??
My code:
polyg=data.frame(c(15, 15, 0, 0), c(15, 0, 0, 15))
point=c(5,5)
bivrp::is_point_inside(point, polyg)
I think we would all agree that a point at 5,5 would be inside a square with coordinates 15,15, 15,0, 0,0, 0,15, however:
> bivrp::is_point_inside(point, polyg)
[1] FALSE
Is there anything I'm doing wrong here?
Note I prioritise the use of bivrp::is_point_inside; I have some older code where I used it and never had any problem, if it doesn't work properly anymore, I would have to revise the older code.
EDIT
This function clearly does not work... Can someone suggest a function that does the same (check if a point is inside a polygon) but works? I will have to revise my old code using it...
Good news. I just tested your example with
secrand it seems to work just fine.Here's the sample code:
Hope this helps.