To give more background, I am processing some data on large areas in small chunks. As the data processes, I would like to display the processed area on a map. I am taking my already processed area and doing a Union on the newly processed area. My problem is that this still keeps each of the verticies, so after doing a lot of areas, I run out of memory, so what I would like to do is remove any unnecessary verticies.
public static MultipolygonShape CustomSimplify(AreaBaseShape targetShape, GeographyUnit targetShapeUnit, double tolerance, DistanceUnit toleranceUnit, SimplificationType simplificationType) { if (targetShapeUnit == GeographyUnit.DecimalDegree) { RectangleShape boundingBox = targetShape.GetBoundingBox(); double latitude = boundingBox.GetCenterPoint().Y; double longitudeDifference = DecimalDegreesHelper.GetLongitudeDifferenceFromDistance(tolerance, toleranceUnit, latitude); // We set GeographyUnit and DistanceUnit both to meter here just because we want to set the same Unit, this is a workaround. return PolygonShape.Simplify(targetShape, GeographyUnit.Meter, longitudeDifference, DistanceUnit.Meter, simplificationType); } else { return PolygonShape.Simplify(targetShape, targetShapeUnit, tolerance, toleranceUnit, simplificationType); } }