private void filter(Iterable<OsmBlockSource.Block> prev, Consumer<Long> next) {
    for (var block : prev) {
      int blockNodes = 0, blockWays = 0, blockRelations = 0;
      for (var elem : block.decodeElements()) {
        if (elem instanceof OsmElement.Node) {
          blockNodes++;
        } else if (elem instanceof OsmElement.Way) {
          blockWays++;
        } else if (elem instanceof OsmElement.Relation) {
          blockRelations++;
        }
        Object wikidata = elem.getString("wikidata");
        if (wikidata instanceof String wikidataString && profile.caresAboutWikidataTranslation(elem)) {
          long qid = parseQid(wikidataString);
          if (qid > 0) {
            next.accept(qid);
          }
        }

      }
      blocks.inc();
      nodes.incBy(blockNodes);
      ways.incBy(blockWays);
      rels.incBy(blockRelations);
    }
  }
Only pass elements that the profile cares about to next step in pipeline.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/Wikidata.java