The influence of the maritime environment such as water currents, water depth, and traffic separation rules should be considered when conducting ship path planning. Additionally, the maneuverability constraints of the ship play a crucial role in navigation. Addressing the limitations of the traditional A-star algorithm in ship path planning, this paper proposes an improved A-star algorithm. Specifically, this paper examines the factors influencing ship navigation safety, and develops a risk model that takes into account water currents, water depth, and obstacles. The goal is to mitigate the total risk of ship collisions and grounding. Secondly, a traffic model is designed to ensure that the planned path adheres to the traffic separation rules and reduces the risk of collision with incoming ships. Then, a turning model and smoothing method are designed to make the generated path easy to track and control for the ship. To validate the effectiveness of the proposed A-star ship path-planning algorithm, three cases are studied in simulations and representative operational scenarios. The results of the cases demonstrate that the proposed A-star ship path-planning algorithm can better control the distance to obstacles, effectively avoid shallow water areas, and comply with traffic separation rules. The safety level of the path is effectively improved.