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.
The following image is how I would like it to look.
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?