Class ExtractLineByLocation

java.lang.Object
org.locationtech.jts.linearref.ExtractLineByLocation

class ExtractLineByLocation extends Object
Extracts the subline of a linear Geometry between two LinearLocations on the line.
  • Field Details

  • Constructor Details

    • ExtractLineByLocation

      public ExtractLineByLocation(Geometry line)
  • Method Details

    • 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 invalid input: '<' start the linear geometry computed will be reversed.
      Parameters:
      start - the start location
      end - the end location
      Returns:
      a linear geometry
    • reverse

      private Geometry reverse(Geometry linear)
    • computeLine

      private LineString computeLine(LinearLocation start, LinearLocation end)
      Assumes input is valid (e.g. start invalid input: '<'= end)
      Parameters:
      start -
      end -
      Returns:
      a linear geometry
    • computeLinear

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