private void init() {
    var cs = line.getCoordinateSequence();
    if (nodeLocations == null) {
      nodeLocations = new double[cs.size()];
      double x1 = cs.getX(0);
      double y1 = cs.getY(0);
      nodeLocations[0] = 0d;
      for (int i = 1; i < cs.size(); i++) {
        double x2 = cs.getX(i);
        double y2 = cs.getY(i);
        double dx = x2 - x1;
        double dy = y2 - y1;
        length += Math.sqrt(dx * dx + dy * dy);
        nodeLocations[i] = length;
        x1 = x2;
        y1 = y2;
      }
    }
  }
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