Railway alignment development in a study area with densely-distributed obstacles, in which regions favorable for alignments are isolated (termed an isolated island effect, i.e., IIE), is a computation-intensive and time-consuming task. To enhance search efficiency and solution quality, an environmental suitability analysis is conducted to identify alignment-favorable regions (AFRs), focusing the subsequent alignment search on these areas. Firstly, a density-based clustering algorithm (DBSCAN) and a specific criterion are customized to distinguish AFR distribution patterns: continuously-distributed AFRs, obstructed effects, and IIEs. Secondly, a study area characterized by IIEs is represented with a semantic topological map (STM), integrating between-island and within-island paths. Specifically, between-island paths are derived through a multi-directional scanning strategy, while within-island paths are optimized using a Floyd-Warshall algorithm. To this end, the intricate alignment optimization problem is simplified into a shortest path problem, tackled with conventional shortest path algorithms (of which Dijkstra’s algorithm is adopted in this work). Lastly, the proposed method is applied to a real case in a mountainous region with karst landforms. Numerical results indicate its superior performance in both construction costs and environmental suitability compared to human designers and a prior alignment optimization method.