  We study a class of edge-coloured graphs, including the chamber systems of
buildings and other geometries such as affine planes, from which we build
coherent configurations (also known as non-commutative association schemes).
The condition we require is that the graph be endowed with a certain distance
function, taking its values in the adjacency algebra (itself generated by the
adjacency operators). When all the edges are of the same colour, the condition
is equivalent to the graph being distance-regular, so our result is a
generalization of the classical fact that distance-regular graphs give rise to
association schemes.
  The Bose-Mesner algebra of the coherent configuration is then isomorphic to
the adjacency algebra of the graph. The latter is more easily computed, and
comes with a "small" set of generators, so we are able to produce examples of
Bose-Mesner algebras with particularly simple presentations.
  When a group acts "strongly transitively", in a certain sense, on a graph, we
show that a distance function as above exists canonically; moreover, when the
graph is (the chamber system of) a building, we show that strong transitivity
is equivalent to the usual condition involving pairs of incident chambers and
apartments.
  We study affine planes in detail. These are not buildings, yet the machinery
developed allows us to state and prove some results which are directly
analogous to classical facts in the theory of projective planes (which {\em
are} buildings). In particular, we prove that an affine plane with a group
acting strongly transitively on it must be Desarguesian.
