In recent years, owing to the advantages of low cost, high efficiency and convenience, an unmanned waterway survey ship has received more and more attention in the area of waterway survey. In the process of collision avoidance, reducing the deviation between the newly planned collision avoidance route and the preplanned route is key to complete the waterway survey duties with accurate survey data by an unmanned waterway survey ship. Due to the problem that the path planned by the traditional A* algorithm cannot quickly approach the preplanned route after obstacle avoidance, an improved A* algorithm is proposed. Based on the original cost function of the A* algorithm, the improved A* algorithm adds a new cost value associated with the vertical distance from the current point to the preplanned route. The value is related to the location of the unmanned waterway survey ship. Firstly, the improved A* algorithm is carried out under the MATLAB simulation environment, and then the actual ship navigation test is carried out by using an unmanned waterway survey ship platform. Moreover, the experimental data are analyzed based on geo-fencing. Experimental results show that compared with the traditional A* algorithm under the premise of safety, the improved A* algorithm can make the unmanned waterway survey ship approach the preplanned route more quickly after avoiding obstacles.