Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingMapDataFeaturesFactory.cs =================================================================== diff -u -r8905298103eb01ce13dd5c1a2f267f879d4fda3e -r3c72e841dad47bf90371626be0e181f5512ba1b0 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingMapDataFeaturesFactory.cs (.../PipingMapDataFeaturesFactory.cs) (revision 8905298103eb01ce13dd5c1a2f267f879d4fda3e) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingMapDataFeaturesFactory.cs (.../PipingMapDataFeaturesFactory.cs) (revision 3c72e841dad47bf90371626be0e181f5512ba1b0) @@ -24,7 +24,6 @@ using Core.Common.Base.Geometry; using Core.Components.Gis.Data; using Core.Components.Gis.Features; -using Core.Components.Gis.Geometries; using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Common.Forms.Views; using Ringtoets.Piping.Data; @@ -52,15 +51,9 @@ for (int i = 0; i < surfaceLines.Length; i++) { - var surfaceLine = surfaceLines[i]; - var feature = new MapFeature(new[] - { - new MapGeometry(new[] - { - surfaceLine.Points.Select(p => new Point2D(p.X, p.Y)) - }) - }); + RingtoetsPipingSurfaceLine surfaceLine = surfaceLines[i]; + MapFeature feature = RingtoetsMapDataFeaturesFactory.CreateSingleLineMapFeature(GetWorldPoints(surfaceLine)); feature.MetaData[RingtoetsCommonFormsResources.MetaData_Name] = surfaceLine.Name; features[i] = feature; @@ -85,15 +78,9 @@ for (int i = 0; i < stochasticSoilModels.Length; i++) { - var stochasticSoilModel = stochasticSoilModels[i]; - var feature = new MapFeature(new[] - { - new MapGeometry(new[] - { - stochasticSoilModel.Geometry.Select(p => new Point2D(p.X, p.Y)) - }) - }); + StochasticSoilModel stochasticSoilModel = stochasticSoilModels[i]; + MapFeature feature = RingtoetsMapDataFeaturesFactory.CreateSingleLineMapFeature(GetWorldPoints(stochasticSoilModel)); feature.MetaData[RingtoetsCommonFormsResources.MetaData_Name] = stochasticSoilModel.Name; features[i] = feature; @@ -132,5 +119,15 @@ return RingtoetsMapDataFeaturesFactory.CreateCalculationFeatures(calculationData); } + + private static IEnumerable GetWorldPoints(RingtoetsPipingSurfaceLine surfaceLine) + { + return surfaceLine.Points.Select(p => new Point2D(p.X, p.Y)); + } + + private static IEnumerable GetWorldPoints(StochasticSoilModel stochasticSoilModel) + { + return stochasticSoilModel.Geometry.Select(p => new Point2D(p.X, p.Y)); + } } } \ No newline at end of file