Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsMapDataFeaturesFactory.cs =================================================================== diff -u -rf718135c08ce7b90cc0eaf40bfb83c9af48a1776 -rf724e2a23cc180381b736c4da1318d87398e5758 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsMapDataFeaturesFactory.cs (.../RingtoetsMapDataFeaturesFactory.cs) (revision f718135c08ce7b90cc0eaf40bfb83c9af48a1776) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsMapDataFeaturesFactory.cs (.../RingtoetsMapDataFeaturesFactory.cs) (revision f724e2a23cc180381b736c4da1318d87398e5758) @@ -26,6 +26,7 @@ using Core.Components.Gis.Data; using Core.Components.Gis.Features; using Core.Components.Gis.Geometries; +using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.FailureMechanism; @@ -67,10 +68,7 @@ { foreach (var location in hydraulicBoundaryDatabase.Locations) { - var feature = GetAsSingleMapFeature(new[] - { - location.Location - }); + var feature = GetAsSingleMapFeature(location.Location); feature.MetaData["ID"] = location.Id; feature.MetaData["Name"] = location.Name; @@ -133,7 +131,7 @@ } /// - /// Create features for the foreshore and dike geometry of the . + /// Create features for the geometry of the . /// /// The profiles to create features for. /// An array of features or an empty array when is null or empty. @@ -147,6 +145,11 @@ return dikeProfiles.Select(dikeProfile => GetAsSingleMapFeature(GetWorldPoints(dikeProfile))).ToArray(); } + /// + /// Create features for the geometry of the . + /// + /// The profiles to create features for. + /// An array of features or an empty array when is null or empty. public static MapFeature[] CreateForeshoreProfilesFeatures(IEnumerable foreshoreProfiles) { if (foreshoreProfiles == null || !foreshoreProfiles.Any()) @@ -157,6 +160,21 @@ return foreshoreProfiles.Select(foreshoreProfile => GetAsSingleMapFeature(GetWorldPoints(foreshoreProfile))).ToArray(); } + /// + /// Create features for the geometry of the . + /// + /// The profiles to create features for. + /// An array of features or an empty array when is null or empty. + public static MapFeature[] CreateStructuresFeatures(IEnumerable structures) + { + if (structures == null || !structures.Any()) + { + return new MapFeature[0]; + } + + return structures.Select(structure => GetAsSingleMapFeature(structure.Location)).ToArray(); + } + private static Point2D[] GetWorldPoints(DikeProfile dikeProfile) { return AdvancedMath2D.FromXToXY( @@ -185,5 +203,16 @@ }) }); } + + private static MapFeature GetAsSingleMapFeature(Point2D point) + { + return new MapFeature(new[] + { + new MapGeometry(new[] + { + new [] { point } + }) + }); + } } } \ No newline at end of file