In many complex networks, such as communication networks, power grids, and transportation networks, the main task is load transmission from sources to destinations. Therefore, the transmission throughput is a very important indicator to measure the network performance, and improving the throughput becomes one of the hotspots in the research of these complex networks. Many researchers have proposed different routing algorithms to improve the network throughput. However, few of them considered the spatial location of nodes in the network. Indeed, many real-world networks can be modeled by spatial networks, where the spatial location of nodes plays a vital role in determining the structure and dynamic behaviors of such networks. Specifically, when the locations of nodes are considered, each link has a length. And the shortest path may have different meaning. Traditionally, the shortest path indicates the path which passes the least number of links from source to destination, or the least number of hops. However, when the length of link is taken into account, the least number of links does not mean the least summation of link lengths along the path. The latter can be called the shortest path length. To this end, we proposes an efficient routing strategy for spatial networks based on the shortest path length in this work. In order to test the effectiveness of the algorithm, the network throughput
${R}_{\rm c}$
is used, at which the network changes from a free flow state to a congestion state, to measure the performance of the network. Simulations of homogeneous and heterogeneous spatial networks show that compared with the traditional least number of hops routing strategy, the routing algorithm based on the shortest path length proposed in this paper can effectively improve the throughput of the network. The routing algorithm proposed in this paper can be applied to many real-world spatial networks for improving their performances.