private static WorkerPipeline.SinkStep<TileBatch> tileStatsWriter(Path layerStatsPath) {
    return prev -> {
      try (var statsWriter = TileSizeStats.newWriter(layerStatsPath)) {
        statsWriter.write(TileSizeStats.headerRow());
        for (var batch : prev) {
          for (var encodedTile : batch.out().get()) {
            for (var line : encodedTile.layerStats()) {
              statsWriter.write(line);
            }
          }
        }
      }
    };
  }
Reads all {@code features}, encodes them in parallel, and writes to {@code output}.
planetiler-core/src/main/java/com/onthegomap/planetiler/archive/TileArchiveWriter.java