private long encodeKey(RenderedFeature feature) {
    var vectorTileFeature = feature.vectorTileFeature();
    byte encodedLayer = commonLayerStrings.encode(vectorTileFeature.layer());

    return encodeKey(
      this.tileOrder.encode(feature.tile()),
      encodedLayer,
      feature.sortKey(),
      feature.group().isPresent()
    );
  }
Returns a function for a single thread to use to serialize rendered features.
planetiler-core/src/main/java/com/onthegomap/planetiler/collection/FeatureGroup.java