# How can envelope angle be calculated?

Azure SQL has a hemisphere limitation where it errors on any geography having an envelope angle greater than 90 degrees.

My coworker wants to set up some detection in the web server to catch such instances before they hit the database. How can envelope angle be calculated from a series of coordinates that define a polygon or multipolygon?

• Besides just calculating a min/max of x (lon) values? Commented May 29, 2014 at 15:48
• @Vince Does longitude alone define envelope angle? (I'm having a hard time even finding a good definition of envelope angle.) From my tests with a simple small rectangle, the envelope angle is affected by the latitude of the points as well. Commented May 29, 2014 at 17:24
• Latitude delta can't exceed 180* Commented May 29, 2014 at 17:36
• Shouldn't this question be: "what is an envelope angle?"? Commented May 29, 2014 at 18:58
• @martinf I thought it was the maximal angle between any two points in the shape(s), but Vince's comments about only considering longitudes made me second-guess myself. Apparently we were both wrong. Commented May 29, 2014 at 19:07