Asked • 04/27/19

Maximum size on the bounding box with ST_MakeEnvelope and && and geography column in PostGIS?

I've done quite a few google searches, but haven't managed to find anything that has helped me directly. I've got a few features in a PostGIS table with a geography column. The features are focused around (latitude, longitude) 0, 100 and 1, 101 (those are literally the points for any POINTS or LINESTRINGS in that column). I'm making a query like this: SELECT GUID, ATTRS, ST_AsGML(GEOG), ACTIVE, CREATED, FTIME FROM FEATURES WHERE GEOG && ST_MakeEnvelope(99, -3, 103, 3, 4326) AND ACTIVE = TRUE ORDER BY CREATED DESC LIMIT 100 And it returns all the data If I change the query to be much larger, then nothing comes back: SELECT GUID, ATTRS, ST_AsGML(GEOG), ACTIVE, CREATED, FTIME FROM FEATURES WHERE GEOG && ST_MakeEnvelope(-75, -80, 110, 3, 4326) AND ACTIVE = TRUE ORDER BY CREATED DESC LIMIT 100 So is there a limit I'm hitting somewhere here I don't know about it? If I change the query to this: SELECT GUID, ATTRS, ST_AsGML(GEOG), ACTIVE, CREATED, FTIME FROM FEATURES WHERE GEOG && ST_MakeEnvelope(-70, -80, 109, 3, 4326) AND ACTIVE = TRUE ORDER BY CREATED DESC LIMIT 100 I still get all my data back! **EDIT** Added the ST_AsEWKT(GEOG) as requested: select ST_AsEWKT(GEOG) from features; st_asewkt ----------------------------------- SRID=4326;POINT(100 0) SRID=4326;POINT(100 0) SRID=4326;POINT(100 0) SRID=4326;POINT(100 0) SRID=4326;POINT(100 0) SRID=4326;POINT(100 0) SRID=4326;POINT(100 0) SRID=4326;LINESTRING(100 0,101 1) SRID=4326;POINT(100 0) SRID=4326;POINT(100 0) SRID=4326;LINESTRING(100 0,101 1) SRID=4326;LINESTRING(100 0,101 1) SRID=4326;LINESTRING(100 0,101 1) SRID=4326;LINESTRING(100 0,101 1) SRID=4326;LINESTRING(100 0,101 1) SRID=4326;LINESTRING(100 0,101 1) SRID=4326;POINT(100 0) SRID=4326;POINT(100 0)

1 Expert Answer

By:

Nick L. answered • 02/02/21

Tutor
New to Wyzant

Lux

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.