This study presents a method to support ship trajectory prediction at waterway confluences using historical Automatic Identification System (AIS) data. The method is meant to improve the recognition accuracy of ship behavior trajectory, assist in the proactive avoidance of collisions, and clarify ship collision responsibility, to ensure the safety of waterway transportation systems in the event of ship encounters induced by waterway confluence or channel limitation. In this study, the ship trajectory based on AIS data is considered from five aspects: time, location, heading, speed, and trajectory by using the piecewise cubic Hermite interpolation method and then quickly clustered by regional navigation rules. Then, an improved K-Nearest Neighbor Algorithm considering the sensitivity of data characteristics (SKNN) is proposed to predict the trajectory of ships, which considers the influence weights of various parameters on ship trajectory prediction. The method is trained and verified using the AIS data of the Yangtze River and Han River intersection in Wuhan. The results show that the accuracy of SKNN is better than that of conventional KNN and Naive Bayes (NB) in the same test case. The accuracy of the ship trajectory prediction method is above 99% and the performance metrics of the SKNN surpass those of both the conventional KNN and NB classifiers, which is helpful for early warning of collision encounters to ensure avoidance.