Class LineString


  • public final class LineString
    extends Object
    Represents a path through a coordinate system. The path consists of a set of linear path elements, drawn between control points.
    Author:
    Jon, Guy Griffiths
    • Method Detail

      • getControlPoints

        public List<HorizontalPosition> getControlPoints()
        Returns the list of control points along this line string.
        Returns:
        an unmodifiable list of control points.
      • getControlPointDistanceKm

        public double getControlPointDistanceKm​(int index)
        Returns the fractional distance along the line string to the control point with the given index.
        Parameters:
        index - The index of the control point. An index of zero represents the start of the line string.
        Returns:
        the distance in km along the whole line string to the control point
        Throws:
        IndexOutOfBoundsException - if index < 0 || index >= number of control points
      • getPathLength

        public double getPathLength()
        Returns:
        The total path length, in km
      • getPointsOnPath

        public List<HorizontalPosition> getPointsOnPath​(int n)
        Returns a list of n points along the path defined by this line string. The first point will be the first control point; the last point will be the last control point. Intermediate points are linearly interpolated between the control points. Note that it is not guaranteed that the intermediate control points will be contained in this list. TODO Add the control points to this list, in the correct location.
        Parameters:
        n - The number of points to return
        Returns:
        an unmodifiable list of n points that lie on this path.
        Throws:
        IllegalArgumentException - if numPoints < 2
      • getCoordinateReferenceSystem

        public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()