I run following code in PostGIS. Both SRID is default, which is 4326.
select ST_Intersects('POINT(104.042455 30.657381)'::GEOGRAPHY(POINT), ST_MakeEnvelope(80, 30, 140, 40, 4326)::GEOGRAPHY(POLYGON))
'POINT(104.042455 30.657381)'::GEOGRAPHY(POINT): This represents a point geography object with longitude 104.042455 and latitude 30.657381.
ST_MakeEnvelope(80, 30, 140, 40, 4326)::GEOGRAPHY(POLYGON): This creates a rectangular polygon (bounding box) with the specified corner coordinates (80,30), (140,40) in the WGS 84 coordinate system (SRID 4326). The rectangle spans from longitude 80 to 140 and latitude 30 to 40.
The point (104.042455, 30.657381) is within the longitude range (80 to 140) and the latitude range (30 to 40) of the bounding box.
Given this, the query should logically return true since the point is clearly within the bounds of the specified rectangle.
But, following return true:
select ST_Intersects('POINT(108.963413 34.284203)'::GEOGRAPHY(POINT), ST_MakeEnvelope(80, 30, 140, 40, 4326)::GEOGRAPHY(POLYGON))
SRID=4326;
? Or if you useST_GeographyFromText
instead of the::
?