Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Given 2 coordinates of a bounding box, bottom left.. Rate Topic Display Mode Topic Options
Author
 Message
 Posted Monday, October 14, 2013 12:37 PM
 Grasshopper Group: General Forum Members Last Login: Saturday, April 5, 2014 1:16 AM Points: 14, Visits: 203
 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.
Post #1504513
 Posted Monday, October 14, 2013 12:58 PM
 SSCommitted Group: General Forum Members Last Login: Thursday, January 15, 2015 5:53 AM Points: 1,539, Visits: 1,820
 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.
Post #1504517
 Posted Monday, October 14, 2013 1:55 PM
 Grasshopper Group: General Forum Members Last Login: Saturday, April 5, 2014 1:16 AM Points: 14, Visits: 203
 "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."Thank you for your response Batgirl, that makes sense, I will have a play tomorrow.D.
Post #1504531
 Posted Monday, October 14, 2013 4:24 PM
 Valued Member Group: General Forum Members Last Login: Friday, October 18, 2013 4:40 PM Points: 70, Visits: 8
 If what they're saying is true, the 4 coordinates are simply:(MINX, MAXY) ------------ (MAXX, MAXY) (MINX, MINY) ------------ (MAXX, MINY)Height = ABS(MAXY - MINY)Width = ABS(MAXX - MINX)
Post #1504569
 Posted Tuesday, October 15, 2013 2:24 AM
 SSC Rookie Group: General Forum Members Last Login: 2 days ago @ 2:42 AM Points: 48, Visits: 633
 Worked a treat, thanks all for your input - my GSCE maths escaped me and I was looking for an over engineered solution..!
Post #1504644

 Permissions