The efficiency of the routing strategy is essential for the sensor-based applications at the edge of internet of things. In many practical monitoring applications, many sensor networks with irregular terrain structure are ubiquitous in nature. The forwarding candidates selected by the Euclidean distance in the routing are not appropriate. To address the problem, a Geodesic Distance-based Routing (GDDR) scheme with insurance of reliable data transmission for sensor networks with irregular terrain structure is proposed. In the GDDR scheme, a novel method is proposed firstly to calculate the geodesic distance using sampling and flooding to reduce the time complexity. In the data transmission process, the geodesic distance is applied in the selection of forwarding candidates to ensure the correct transfer direction, path connectivity and avoidance of routing holes. A certain number of forwarding candidates are selected based on the remaining energy and geodesic distance. And, the number of selected candidates is variable according to the geodesic distance to reduce and balance the energy cost. The proposed scheme not only can be used in the network with irregular topology but it also can be applied in the network with a regular shape. The performance is tested and the effectiveness of the proposed GDDR scheme is evaluated by the simulation.