I have a quite simple problem but somehow I just fail to solve it.
There is a polygon and a range xsize and ysize. The x and y size determines the mapnik generated image.
The polygon should now be made to fit best, by deciding if:
- it is good already or
- a x and y swap and later rotation by 90 degress would make it fit best.
Boundary box and Envelope is given, so no problems there.
The problem is realy just the rotation criterion which I'm lost in.
I hope you understand the simple problem and can show me an idea how to solve it.
Thanks!

