I have two points which represents lower left and upper right point of BBOX. I have one point which SHOULD be somewhere inside and I want to test it.
I have all of them as 'geometry(POINT, 4326)' data type.
When I try functions:
ST_MakeBox2D( geom4326ur, geom4326ll ) ST_Envelope ( ST_MakeBox2D( geom4326ur, geom4326ll ) Box2D
I get only linestring geometry connecting these two points. I don't get 4 points of box which I need to transform them to polygon and then check with ST_Intersect if all points are inside their bounding boxes.
Can you help me solve this? I would like to have most effective solution - I am running this on millions of points.