  We characterize uniformly perfect, complete, doubling metric spaces which
embed bi- Lipschitzly into Euclidean space. Our result applies in particular to
spaces of Grushin type equipped with Carnot-Carath\'eodory distance. Hence we
obtain the first example of a sub-Riemannian mani- fold admitting such a
bi-Lipschitz embedding. Our techniques involve a passage from local to global
information, building on work of Christ and McShane. A new feature of our proof
is the verification of the co-Lipschitz condition. This verification splits
into a large scale case and a local case. These cases are distinguished by a
relative distance map which is associated to a Whitney-type decom- position of
an open subset {\Omega} of the space. We prove that if the Whitney cubes embed
uniformly bi-Lipschitzly into a fixed Euclidean space, and if the complement of
{\Omega} also embeds, then so does the full space.
