I want to create bounding boxes around polygons, the bounding boxes will then be used in a ST_Hausdorffdistance to determain the squarness of every polygon. My first choice is using the ST_Envelope function but the problem with this is that all the envelopes are orientated to the north.

The result is the following image.

bouding box created with ST_Envelope

The following image is how I would like it to look.

bouding box created with minimum bounding geometry tool in ArcGIS

This is created with the Minimum bounding geometry tool in ArcGIS. Is there any possibilty to do this in PostGIS?

I tried doing it with the Box2D function in PostGIS, but I can't seem to find the way to save the geometry to the geom column?

Browse other questions tagged or ask your own question.