Due to the limitations of the existing methods (for example, the route binary tree method) that can only automatically generate routes based on a single chart, a method for automatically generating the shortest distance route based on an obstacle spatial database is proposed. Using this proposed method, the route between two arbitrary points at sea can be automatically generated. First, the differences in accuracy and updating time of charts are quantitatively analysed. Next, the mechanism for updating obstacles is designed, an obstacle spatial database is constructed, and the obstacle data extracted from multiple charts are fused. Finally, considering the effect of efficiency on the amount of obstacle data, a route window and an improved R-tree index are designed for quickly extracting and querying the obstacle database. The experimental results demonstrate that compared with existing methods, the proposed method can generate the shortest distance between two arbitrary points at sea and eliminates the limitation of the area of the chart. In addition, with data from multiple charts, the route generated by the proposed method is more reliable than that of the existing methods, and it is more efficient.