public LineString get(double start, double end) {
    if (start < 0d || end > 1d || end < start) {
      throw new IllegalArgumentException("Invalid range: " + start + " to " + end);
    }
    if (start <= 0 && end >= 1) {
      return line;
    }
    var cs = line.getCoordinateSequence();
    init();
    MutableCoordinateSequence result = new MutableCoordinateSequence();

    double startPos = start * length;
    double endPos = end * length;
    var first = floorIndex(startPos);
    var last = lowerIndex(endPos);
    addInterpolated(result, cs, first, startPos);
    for (int i = first + 1; i <= last; i++) {
      result.addPoint(cs.getX(i), cs.getY(i));
    }
    addInterpolated(result, cs, last, endPos);

    return GeoUtils.JTS_FACTORY.createLineString(result);
  }
Returns a partial segment of this line from {@code start} to {@code end} where 0 is the beginning of the line and 1
is the end.
planetiler-core/src/main/java/com/onthegomap/planetiler/geo/LineSplitter.java