By default, PostGIS calculates the Envelope or Extent of a polygon based on the bounding box of the polygon ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
This gives a result like so:
However, I'm looking for a result more like this:
As far as I know, the best algorithm that I can come up with is:
أكثر...
This gives a result like so:

However, I'm looking for a result more like this:

As far as I know, the best algorithm that I can come up with is:
- Determine angle a to rotate the polygon X to be parallel with the x-axis
- Rotate X a degrees, calculate the envelope Y of rotated polygon X
- Rotate Y -a degrees
أكثر...