public VectorTile addLayerFeatures(String layerName, List<Feature> features) {
    if (features.isEmpty()) {
      return this;
    }
    Layer layer = layers.get(layerName);
    if (layer == null) {
      layer = new Layer();
      layers.put(layerName, layer);
    }
    var statsTracker = layerStatsTracker.forLayer(layerName);

    for (Feature inFeature : features) {
      if (inFeature != null && inFeature.geometry().commands().length > 0) {
        EncodedFeature outFeature = new EncodedFeature(inFeature);

        for (Map.Entry<String, ?> e : inFeature.tags().entrySet()) {
          // skip attribute without value
          if (e.getValue() != null) {
            String key = e.getKey();
            Object value = e.getValue();
            outFeature.tags.add(layer.key(key));
            outFeature.tags.add(layer.value(value));
            statsTracker.accept(key, value);
          }
        }

        layer.encodedFeatures.add(outFeature);
      }
    }
    return this;
  }
Adds features in a layer to this tile.

@param layerName name of the layer in this tile to add the features to
@param features  features to add to the tile
@return this encoder for chaining
planetiler-core/src/main/java/com/onthegomap/planetiler/VectorTile.java