private BiConsumer<Contexts.FeaturePostMatch, Feature> attributeProcessor(AttributeDefinition attribute) {
    var tagKey = attribute.key();

    Object attributeMinZoom = attribute.minZoom();
    attributeMinZoom = attributeMinZoom == null ? "0" : attributeMinZoom;

    var minZoomByValue = attribute.minZoomByValue();
    minZoomByValue = minZoomByValue == null ? Map.of() : minZoomByValue;

    //Workaround because numeric keys are mapped as String
    minZoomByValue = tagValueProducer.remapKeysByType(tagKey, minZoomByValue);

    var attributeValueProducer = attributeValueProducer(attribute);
    var fallback = attribute.fallback();

    var attrIncludeWhen = attribute.includeWhen();
    var attrExcludeWhen = attribute.excludeWhen();

    var attributeTest =
      Expression.and(
        attrIncludeWhen == null ? Expression.TRUE :
          BooleanExpressionParser.parse(attrIncludeWhen, tagValueProducer,
            featurePostMatchContext),
        attrExcludeWhen == null ? Expression.TRUE :
          not(BooleanExpressionParser.parse(attrExcludeWhen, tagValueProducer,
            featurePostMatchContext))
      ).simplify();

    var minTileCoverage = attrIncludeWhen == null ? null : attribute.minTileCoverSize();

    Function<Contexts.FeatureAttribute, Integer> attributeZoomProducer =
      attributeZoomThreshold(minTileCoverage, attributeMinZoom, minZoomByValue);

    return (context, f) -> {
      Object value = null;
      if (attributeTest.evaluate(context)) {
        value = attributeValueProducer.apply(context);
        if ("".equals(value)) {
          value = null;
        }
      }
      if (value == null) {
        value = fallback;
      }
      if (value != null) {
        if (attributeZoomProducer != null) {
          Integer minzoom = attributeZoomProducer.apply(context.createAttrZoomContext(value));
          if (minzoom != null) {
            f.setAttrWithMinzoom(tagKey, value, minzoom);
          } else {
            f.setAttr(tagKey, value);
          }
        } else {
          f.setAttr(tagKey, value);
        }
      }
    };
  }
Generates a function which produces a fully-configured attribute for a feature.

@param attribute - configuration for this attribute
@return processing logic
planetiler-custommap/src/main/java/com/onthegomap/planetiler/custommap/ConfiguredFeature.java