Class ExtractLineByLocation


  • class ExtractLineByLocation
    extends java.lang.Object
    Extracts the subline of a linear Geometry between two LinearLocations on the line.
    • Constructor Detail

      • ExtractLineByLocation

        public ExtractLineByLocation​(Geometry line)
    • Method Detail

      • extract

        public static Geometry extract​(Geometry line,
                                       LinearLocation start,
                                       LinearLocation end)
        Computes the subline of a LineString between two LinearLocations on the line. If the start location is after the end location, the computed linear geometry has reverse orientation to the input line.
        Parameters:
        line - the line to use as the baseline
        start - the start location
        end - the end location
        Returns:
        the extracted subline
      • extract

        public Geometry extract​(LinearLocation start,
                                LinearLocation end)
        Extracts a subline of the input. If end < start the linear geometry computed will be reversed.
        Parameters:
        start - the start location
        end - the end location
        Returns:
        a linear geometry
      • computeLinear

        private Geometry computeLinear​(LinearLocation start,
                                       LinearLocation end)
        Assumes input is valid (e.g. start <= end)
        Parameters:
        start -
        end -
        Returns:
        a linear geometry