Skip to content

Commit 743e88f

Browse files
Minor bug fix for multipolygons (#3252)
Co-authored-by: rupertbenbrook <[email protected]>
1 parent 5a6d4f9 commit 743e88f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ExtLibs/AltitudeAngelWings/Service/AltitudeAngelService.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,17 @@ private void ProcessFeatures(IMap map)
305305

306306
case GeoJSONObjectType.MultiPolygon:
307307
// TODO: This does not work for polygons with holes and just does the outer polygon
308-
foreach (var poly in ((MultiPolygon)feature.Geometry).Coordinates)
308+
for (var index = 0; index < ((MultiPolygon)feature.Geometry).Coordinates.Count; index++)
309309
{
310+
var poly = ((MultiPolygon)feature.Geometry).Coordinates[index];
310311
var coordinates =
311312
poly.Coordinates[0].Coordinates.OfType<Position>()
312313
.Select(c => new LatLong(c.Latitude, c.Longitude))
313314
.ToList();
314315

315316
var colorInfo = properties.ToColorInfo(_settings.MapOpacityAdjust);
316-
overlayFeatures.Add(new OverlayFeature(feature.Id, OverlayFeatureType.Line, coordinates, colorInfo, feature));
317+
overlayFeatures.Add(new OverlayFeature($"{feature.Id}-{index}", OverlayFeatureType.Line,
318+
coordinates, colorInfo, feature));
317319
}
318320

319321
break;

0 commit comments

Comments
 (0)