1

How to get a bounding box (in the form of a Polygon, or anything else where it's easy to extract the corner coordinates from) of a given Geography item? Something that would look like:

SELECT Boundary(geog) AS boundingBox FROM segments;

Where geog is a MULTILINE geography.

Seems like a trivial question, but my experience so far is limited and I did not have any luck with the docs (http://www.postgis.org/documentation/manual-1.5/reference.html ) Tried ST_Boundary and Box2D but they do not work on geographies.

3

Cast the geography to a geometry type and then call ST_Envelope on the geometry.

SELECT ST_Envelope(geog::geometry) as boundingBox FROM segments;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.