public List<LineString> getMergedLineStrings() {
    output.clear();
    List<List<Coordinate>> edges = nodeLines(input);
    buildNodes(edges);

    degreeTwoMerge();

    if (loopMinLength > 0.0) {
      breakLoops();
      degreeTwoMerge();
    }

    if (stubMinLength > 0.0) {
      removeShortStubEdges();
      // removeShortStubEdges does degreeTwoMerge internally
    }

    if (pipeline != null || tolerance >= 0.0) {
      simplify();
      removeDuplicatedEdges();
      degreeTwoMerge();
    }

    if (mergeStrokes) {
      strokeMerge();
      degreeTwoMerge();
    }

    if (minLength > 0) {
      removeShortEdges();
    }

    List<LineString> result = new ArrayList<>();

    for (var node : output) {
      for (var edge : node.getEdges()) {
        if (edge.main) {
          result.add(factory.createLineString(edge.coordinates.toArray(Coordinate[]::new)));
        }
      }
    }

    return result;
  }
Processes the added geometries and returns the merged linestrings.
<p>
Can be called more than once.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/LoopLineMerger.java