  This paper investigates the connections between buildings and Hecke algebras
through the combinatorial study of two algebras spanned by averaging operators
on buildings. As a consequence we obtain a geometric and combinatorial
description of certain Hecke algebras, and in particular of the Macdonald
spherical functions and the center of affine Hecke algebras. The results of
this paper are used in later work to study spherical harmonic analysis on
affine buildings, and to study isotropic random walks on affine buildings.
