The task of accurately forecasting the trajectory of a vessel, and in general a moving object operating in free space until its destination remains an open challenge. This paper addresses this problem by describing an unsupervised data-driven framework for short and extended horizon forecasts, from the perspectives of data mining and machine learning. We propose a data-driven algorithmic approach named "EnvClus*" that models efficiently historical vessel trajectories at a global scale, forming a mobility graph that depicts the most likely movements among two ports. EnvClus* is able to make tailored route forecasts considering the characteristics of the vessels (i.e. length, draught) along with information regarding the executed trip. The proposed method is able to forecast the most likely realistic and smooth trajectory from a given query position of a vessel (entire route or underway forecasting) towards its destination port. We illustrate the accuracy and effectiveness of our method through a series of scenarios for long and short term forecasting using real world data from around the globe. These experiments indicate an overall improvement of 33% over state-of-the-art and baseline methods; with the benefits of our approach being more apparent when dealing with longer trips from container vessels.