This PostGIS one-off query returns true:
psql=> select ST_Covers(
ST_SetSRID(ST_MakeBox2D(ST_Point(-180, -30), ST_Point(20, 90)), 4326),
ST_SetSRID(ST_Point(-77.4874420166016, 39.043758392334), 4326));
st_covers
-----------
t
But if you cast both geometries to geographies, it returns false:
psql=> select ST_Covers(
ST_SetSRID(ST_MakeBox2D(ST_Point(-180, -30), ST_Point(20, 90)), 4326)::geography,
ST_SetSRID(ST_Point(-77.4874420166016, 39.043758392334), 4326)::geography);
st_covers
-----------
f
I understand from this old question and this other old question that this is because geography uses great circles to connect points in a polygon, not parallels and meridians.
The question is, how do you convert a parallels-and-meridians bounding rectangle to a geography object that covers exactly the same region of the earth? In the real thing, these rectangles go into a table which is then joined against another table with a long list of points, and that table has to use geography for other reasons, so I need these parallel-and-meridian rectangles as geographies so the indices work properly.