The problem depends on what you consider width and height.
Technically speaking, with complex polygons, there is not such thing as height. There is the longest diagonal and perhaps the complement diagonal. If your polygon has only four vertices than it becomes a tetragon or quadrilateral, if all the angles are 90 degrees it is a rectangle. If you can reduce your polygons to 4 vertices (taking out vertices where the angle is close to 180 degrees for example) you can get a rectangle or a pseudo rectangle if the angles are close enough to 90. Once you have a rectangle, pick any corner and calculate the distance to the next vertex and to the previous vertex (a line between two vertices is a ILine). That should get you width and height. If you have large polygons near one of the poles, depending on the coordinate system you would get different results depending on which vertices you start with, perhaps an average would be appropriate. As to which is the width and height, that depends on you definition of them (longest, most north-south, perpendicular to a road, etc.)