Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs =================================================================== diff -u -r7f9ffc9e3636023563eedd6cc95bad8c4b158324 -rcf913a00f5768780ab2f8bd8d5145069581a8068 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision 7f9ffc9e3636023563eedd6cc95bad8c4b158324) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision cf913a00f5768780ab2f8bd8d5145069581a8068) @@ -100,20 +100,22 @@ return input.ForeshoreGeometry.Select(c => new HydraRingForelandPoint(c.X, c.Y)); } - private static IEnumerable ParseProfilePoints(IEnumerable profileSections) + private static IEnumerable ParseProfilePoints(IList roughnessProfilePoints) { - RoughnessProfileSection firstProfileSection = profileSections.FirstOrDefault(); - if (firstProfileSection == null) + for (var i = 0; i < roughnessProfilePoints.Count; i++) { - yield break; - } + var roughnessProfilePoint = roughnessProfilePoints.ElementAt(i); - // By default, the roughness is 1.0 (no reduction due to bed friction). - yield return new HydraRingRoughnessProfilePoint(firstProfileSection.StartingPoint.X, firstProfileSection.StartingPoint.Y, 1); + if (i == 0) + { + yield return new HydraRingRoughnessProfilePoint(roughnessProfilePoint.Point.X, roughnessProfilePoint.Point.Y, 1.0); + } + else + { + var precedingRoughnessProfilePoint = roughnessProfilePoints.ElementAt(i - 1); - foreach (var profileSection in profileSections) - { - yield return new HydraRingRoughnessProfilePoint(profileSection.EndingPoint.X, profileSection.EndingPoint.Y, profileSection.Roughness); + yield return new HydraRingRoughnessProfilePoint(roughnessProfilePoint.Point.X, roughnessProfilePoint.Point.Y, precedingRoughnessProfilePoint.Roughness); + } } }