Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/ReferenceLine.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r8c7c25ee0b61c182e38073f56cb6376c511ccbf2 --- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/ReferenceLine.cs (.../ReferenceLine.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/ReferenceLine.cs (.../ReferenceLine.cs) (revision 8c7c25ee0b61c182e38073f56cb6376c511ccbf2) @@ -46,6 +46,11 @@ public IEnumerable Points { get; private set; } /// + /// Gets the total length of the reference line. + /// + public double Length { get; private set; } + + /// /// Sets the geometry of the reference line. /// /// The sequence of points defining the reference line geometry. @@ -56,13 +61,15 @@ { throw new ArgumentNullException(nameof(newPoints), RingtoetsCommonDataResources.ReferenceLine_SetGeometry_New_geometry_cannot_be_null); } + Point2D[] point2Ds = newPoints.ToArray(); if (point2Ds.Any(p => p == null)) { throw new ArgumentException(RingtoetsCommonDataResources.ReferenceLine_SetGeometry_New_geometry_has_null_coordinate, nameof(newPoints)); } Points = point2Ds; + Length = Math2D.Length(Points); } } } \ No newline at end of file