  A field theory of the Anderson transition in two dimensional disordered
systems with spin-orbit interactions and time-reversal symmetry is developed,
in which the proliferation of vortex-like topological defects is essential for
localization. The sign of vortex fugacity determines the $Z_2$ topological
class of the localized phase. There are two distinct, but equivalent
transitions between the metallic phase and the two insulating phases. The
critical conductivity and correlation length exponent of these transitions are
computed in a $N=1-\epsilon$ expansion in the number of replicas, where for
small $\epsilon$ the critical points are perturbatively connected to the
Kosterlitz Thouless critical point. Delocalized states, which arise at the
surface of weak topological insulators and topological crystalline insulators,
occur because vortex proliferation is forbidden due to the presence of
symmetries that are violated by disorder, but are restored by disorder
averaging.
