From 743e88f4540adfdcbf349c9641abe94b6a7821b5 Mon Sep 17 00:00:00 2001 From: Rupert Benbrook Date: Thu, 7 Dec 2023 01:09:41 +0000 Subject: [PATCH] Minor bug fix for multipolygons (#3252) Co-authored-by: rupertbenbrook --- ExtLibs/AltitudeAngelWings/Service/AltitudeAngelService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ExtLibs/AltitudeAngelWings/Service/AltitudeAngelService.cs b/ExtLibs/AltitudeAngelWings/Service/AltitudeAngelService.cs index d315de8843..3f44512d5f 100644 --- a/ExtLibs/AltitudeAngelWings/Service/AltitudeAngelService.cs +++ b/ExtLibs/AltitudeAngelWings/Service/AltitudeAngelService.cs @@ -305,15 +305,17 @@ private void ProcessFeatures(IMap map) case GeoJSONObjectType.MultiPolygon: // TODO: This does not work for polygons with holes and just does the outer polygon - foreach (var poly in ((MultiPolygon)feature.Geometry).Coordinates) + for (var index = 0; index < ((MultiPolygon)feature.Geometry).Coordinates.Count; index++) { + var poly = ((MultiPolygon)feature.Geometry).Coordinates[index]; var coordinates = poly.Coordinates[0].Coordinates.OfType() .Select(c => new LatLong(c.Latitude, c.Longitude)) .ToList(); var colorInfo = properties.ToColorInfo(_settings.MapOpacityAdjust); - overlayFeatures.Add(new OverlayFeature(feature.Id, OverlayFeatureType.Line, coordinates, colorInfo, feature)); + overlayFeatures.Add(new OverlayFeature($"{feature.Id}-{index}", OverlayFeatureType.Line, + coordinates, colorInfo, feature)); } break;