Spatial orientation and navigation rely on the acquisition of several types of sensory information. This information is then transformed into a neural code for space in the hippocampal formation through the activity of place cells, grid cells and head-direction cells. These spatial representations, in turn, are thought to guide long-range navigation. But how the representations encoded by these different cell types are integrated in the brain to form a neural 'map and compass' is largely unknown. Here, we discuss this problem in the context of spatial navigation by bats and rats. We review the experimental findings and theoretical models that provide insight into the mechanisms that link sensory systems to spatial representations and to large-scale natural navigation.