private Index<T> index(boolean warn) {
    if (expressions.isEmpty()) {
      return new EmptyIndex<>();
    }
    if (contains(Expression.MatchSource.class::isInstance)) {
      return new SourceIndex<>(this, warn);
    } else if (contains(Expression.MatchSourceLayer.class::isInstance)) {
      return new SourceLayerIndex<>(this, warn);
    } else if (contains(Expression.MatchType.class::isInstance)) {
      return new GeometryTypeIndex<>(this, warn);
    }
    return new KeyIndex<>(simplify(), warn);
  }
Same as {@link #index()} but logs a warning when there are degenerate expressions that must be evaluated on every
input.
planetiler-core/src/main/java/com/onthegomap/planetiler/expression/MultiExpression.java