@ Pure public double getLength ( ) { if ( this . length < 0 ) { double segmentLength = 0 ; for ( final PointGroup group : groups ( ) ) { Point2d previousPts = null ; for ( final Point2d pts : group . points ( ) ) { if ( previousPts != null ) { segmentLength += previousPts . getDistance ( pts ) ; } previousPts = pts ; } } this . length = segmentLength ; } return this . length ; }
Replies the length of this polyline . The length is the distance between first point and the last point of the polyline .