[postgis-users] Get the bounding box?

Michael A. Peters mpeters at shastaherps.org
Mon Jul 19 23:17:36 PDT 2010

First, thank you to the developers. Until about a week ago, my code for
range map generation was ugly and complex and broke frequently, and now
that I am using PostGIS - it's a LOT simpler.

I have one map that still needs to be ported to the new way of doing things.


The contact zone is an intersection between polygons from two geometries.
I am getting that from PostGIS via ST_Intersection and it looks perfect.

The map shows creeks in the contact zone and a buffer area around it, and
right now, the coordinates for what to grab is hard coded. What I want it
to do is grab X kilometers in each compass directions around the
intersection, so that as the range maps for the species are updated
resulting in altered contact zone, the map will auto-adjust.

I can't figure out how to get the bounding box for the intersection. It
would be nice to be able to simply ask for the bounding box + X kilometers
in each direction if PostGIS can do that (I'm running 1.3.2 on CentOS -
that's stock EPEL build) but I can do the math outside of PostGIS if
necessary. I just can't figure out how to get the bounding box returned.

Thanks for any tips.

Michael A. Peters


More information about the postgis-users mailing list