Shanxi Province hosts a rich diversity of traditional villages. From a river basin perspective, adherence to natural laws and the removal of administrative barriers are essential for reshaping the conservation paradigm. Using spatial analysis and multiscale geographically weighted regression, this study revealed the spatial patterns of 619 traditional villages and how environmental, socioeconomic, and historical–cultural factors shape the spatial heterogeneity. Villages clustered within the Yellow River Basin and the Haihe River Basin, forming an agglomeration belt and three high-density cores. Distance to rivers was a key factor in village siting, with 70.8% located within 3 km of the nearest river. Village density exhibited a U-shaped relationship with distance to roads, and an inverted U-shaped relationship with distance to county-level administrative centers. The interaction between intangible cultural heritage density and average annual precipitation showed the strongest explanatory power, with positive local regression coefficients exceeding 95% and 72%, respectively. Traditional villages constitute an evolving human–environment system in which water resources underpin spatial patterns and intangible cultural heritage sustains endogenous cultural vitality. These findings provide a theoretical framework for graded conservation and resource coordination at the river basin scale.
Traditional villages in river basins preserve rural landscapes through both environmental adaptation and accumulated heritage governance. Taking 173 national-level traditional villages in the Fenhe River Basin as the study objects, this study examines their spatial patterns and the heterogeneity of influencing factors using kernel density estimation, nearest-neighbor analysis, spatial autocorrelation, optimal-parameters-based geographical detector, and multiscale geographically weighted regression. The villages display a significant clustered distribution rather than a random or administratively bounded pattern, forming a belt-like structure along the Fenhe River, its major tributaries, and mountain-basin transition zones, with high-density cores in the Taiyuan and Linfen basins. Among all examined factors, the enrichment of cultural relic protection units shows the strongest explanatory power in the OPGD results, with a q-value of 0.4349. Its MGWR coefficients are also predominantly positive and significant, suggesting that officially recognized heritage resources act as spatial anchors for the persistence and organization of traditional villages. Precipitation, elevation, intangible cultural heritage, per capita Gross Domestic Product (GDP), and historical post-road accessibility further shape village density, but their effects are spatially uneven. These findings suggest that conservation in the Fenhe River Basin should move beyond isolated village repair toward a watershed-scale linear heritage network linking river corridors, historical routes, cultural relic protection units, and cross-county governance.