Spatial and Commuting Networks: A Unifying Perspective