title: How do I merge polygons (latitude & longitude)?
body: <p>I have polygons defined on a map with latitude &amp; longitude as the coordinate system. I want to merge all overlapping polygons.
  <a href="https://i.stack.imgur.com/eeAk3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eeAk3.png" alt="enter image description here"></a></p>
  
  <p>From this question <a href="https://stackoverflow.com/questions/2667748/how-do-i-combine-complex-polygons">Question</a></p>
  
  <p>I found this software: <a href="http://www.cs.man.ac.uk/~toby/alan/software/#ports" rel="nofollow noreferrer">Software</a></p>
  
  <p>I downloaded the code an it works great for Cartesian coordinates. But, I have no idea how to utilize it for latitude &amp; longitude.</p>
  
  <p>Whats the best way to approach this problem?</p>
  
  <p>For example here are the polygons I want to merge:</p>
  
  <pre><code>        var polyA = new List&lt;GpsLocation&gt;();
          var pA1 = new GpsLocation(0, 0);
          polyA.Add(pA1);
          var pA2 = GpsHelper.CreateLocationBasedOnBearingDistance(pA1, 5, 100);
          polyA.Add(pA2);
          var pA3 = GpsHelper.CreateLocationBasedOnBearingDistance(pA2, 95, 100);
          polyA.Add(pA3);
          var pA4 = GpsHelper.CreateLocationBasedOnBearingDistance(pA3, 185, 100);
          polyA.Add(pA4);
  
          var polyB = new List&lt;GpsLocation&gt;();
  
          var pB1 = GpsHelper.CreateLocationBasedOnBearingDistance(pA1, 95, 50);
          polyB.Add(pB1);
          var pB2 = GpsHelper.CreateLocationBasedOnBearingDistance(pB1, 5, 100);
          polyB.Add(pB2);
          var pB3 = GpsHelper.CreateLocationBasedOnBearingDistance(pB2, 95, 100);
          polyB.Add(pB3);
          var pB4 = GpsHelper.CreateLocationBasedOnBearingDistance(pB3, 185, 100);
          polyB.Add(pB4);
  </code></pre>