I have polygons defined on a map with latitude & longitude as the coordinate system. I want to merge all overlapping polygons.
From this question Question
I found this software: Software
I downloaded the code an it works great for Cartesian coordinates. But, I have no idea how to utilize it for latitude & longitude.
Whats the best way to approach this problem?
For example here are the polygons I want to merge:
var polyA = new List<GpsLocation>();
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<GpsLocation>();
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);