title: Calculate Convex Hull of points from a set of (lat/long) points
body: <p>I am working on a web app with Google Map that I’d like to display a “coverage area”/’ geographical area”  by creating a polygon overlay of a given set of geo coordinates/points.</p>
  
  <p>The “coverage area” can consist of thousands of the geo coordinates (Longitude and Latitude  data stored in a table in sql server). Ideally, I’d like to calculate the Convex Hull points from the sql server database (2008 R2) so I can pass the results (points) to the Google Map to create the polygon overlay.</p>
  
  <p>The sample here (<a href="http://www.geocodezip.com/v3_map-markers_ConvexHull.asp" rel="nofollow">http://www.geocodezip.com/v3_map-markers_ConvexHull.asp</a>)  is exactly what I am looking for, except that I’d like to get the hull points on the right-panel straight from the SQL server if possible. The reason is that I may have to process thousands of the geo coordinates. I’d rather not to retrieve a huge amount of data from the database and then send to the client using JavaScript to calculate the convex hull points.</p>
  
  <p>Any help will be very much appreciated!!!</p>
  
  <p>Thank you.</p>