• dburtenshaw (10/14/2013)


    I have a strange one for you please..

    Given 2 coordinates of a bounding box from a geography polygon, bottom left and top right, how can I find all 4 coordinates of the whole bounding box?

    I know this is a strange one, but I currently have a system where only the bottom left coordinate and top right one are recorded in the db, I need to work backwards from these two points to ascertain the original 4 points of the bounding box.

    I've run many Google searches but have come up blank, can am aware of the ST_Envelope command, which will give me the bounding box of a geography type, but given just two coordinates of a box, how can I get the other two (bottom right and top left).

    Hope this is clear.. any help would be much appreciated. thanks!

    Duncan.

    The bottom left should be expressed as (MINX,MINY) and the top right as (MAXX, MAXY) so the other two can be derived (MINX, MAXY) is top left and (MAXX, MINY) is bottom right.