Introduction

"Chinese Traditional Villages"1 not only preserve rich historical information and unique cultural landscapes but also embody unique folk customs and historical evolution. Furthermore, these villages serve as material carriers of historical memory, emotional bonds of cultural identity, and key cornerstones of sustainable rural development. The protection of these villages is closely linked to the United Nations Sustainable Development Goals (SDG 11)2, "Sustainable Cities and Communities." By maintaining the cultural diversity, ecological integrity, and social cohesion of traditional villages, this effort can contribute a Chinese solution to building inclusive, safe, and resilient human settlements worldwide.

The rapid economic development and accelerated urbanization3 have led to an increasingly severe imbalance between urban and rural development4. A large number of traditional villages now face a systemic crisis, characterized by population decline5, land fragmentation, and ecological degradation. Consequently, their numbers have sharply decreased, placing them on the brink of extinction. In this context, it is highly significant to explore ways to integrate the cultural preservation of traditional villages with sustainable development goals. This research aims to promote the sustainable development of rural communities while protecting the historical context and offering insights that could facilitate the achievement of global sustainable development goals.

In the context of globalization and urbanization, villages worldwide face similar challenges. For example, villages in the Italian Alps have experienced excessive population loss and changes in spatial structure6, while rural India has suffered severe damage due to natural and human factors7. By comparing these international cases, researchers can not only better understand and address the problems in the Beijing-Tianjin-Hebei region but also verify and enrich their research methods. This analysis demonstrates the global significance of traditional village protection in the Beijing-Tianjin-Hebei region and emphasizes the feasibility of adopting similar methods in other areas. It provides an important reference for the protection and development of villages in developing countries.

At present, the study of traditional villages has shown a trend of multidisciplinary integration, integrating perspectives from geography8, history9, ecology10, and others. The research methodology is now different from the traditional one that focused on theoretical studies11,12, tourism resources13, and historical artifacts14. With the improvement of research methodologies and techniques, current scholars are more inclined to adopt a macroscopic perspective to study traditional villages. They use advanced methods such as Geographic Information System (GIS) technology15, spatial data analysis (in some cases performed with GeoDa Software)16, Space Syntax9, and GWR models17 to deeply analyze the spatial distribution and evolution of traditional villages. This macro perspective echoes the "core-periphery" theory, which explores how resources and development opportunities are unevenly distributed among different regions, forming core and peripheral areas of development. This distribution thus affects the survival and development of traditional villages.

However, existing research still has significant limitations. First, in terms of research scale, most results rely excessively on a single division method, such as administrative divisions, topography, geomorphology18, or watersheds19. It is common to take national20, provincial21, and city (county) levels22 or specific terrain areas23 as research objects but to ignore the integrity of regions with special geographical and cultural characteristics, such as the Beijing-Tianjin-Hebei area. Affected by the natural geographical barrier of the Yanshan-Taihang Mountains, the distribution and development of traditional villages in this region exhibit unique regional linkages, and existing research has failed to fully consider this key factor. Second, at the level of influencing factor analysis, factors such as the natural environment, socio-economics24,25, and historical culture26 are often discussed separately, lacking systematic research on the interaction mechanisms of multi-dimensional factors. Furthermore, an effective multi-factor coupling analysis model has not yet been established.

This study focuses on 310 national traditional villages in the Beijing-Tianjin-Hebei region and uses ArcGIS technology to integrate 10 key driving factors, such as physical geography, historical culture, and social economy, to build a multidimensional spatial database. Research methods, including spatial autocorrelation analysis, OLS, GWR, and Geodetector models, are used to explore the driving mechanism of spatial differences in traditional villages. This aims to overcome the scale and factor analysis limitations of traditional research and provide more comprehensive and accurate theoretical support and practical bases for the protection and sustainable development of traditional villages.

This study not only provides a theoretical explanation for the spatial differences of traditional villages in the Beijing-Tianjin-Hebei region but also contributes to the specific goals of "Protect the World’s Cultural and Natural Heritage" and "Inclusive and Sustainable Urbanization" in SDG 11 through differentiated protection strategies. It provides a scientific basis for policymaking in similar regions.

Study area and data

Study area

The year 2024 marks the 10th anniversary of the coordinated development strategy for Beijing, Tianjin, and Hebei being designated as a national priority. Over the past decade, China has continuously promoted this strategy. Recently, with the nation’s heightened focus on traditional villages, research into these communities has attracted significant attention from experts and scholars. The traditional villages in the Beijing-Tianjin-Hebei region are geographically connected, maintain close interpersonal relationships, demonstrate regional cohesion, and share a common culture. These villages are valuable historical and cultural assets, developed over centuries, and they reflect the unique spiritual values of the Chinese people as well as a rich regional folk culture27.

Historically, academic research has primarily concentrated on Hebei Province. However, solely analyzing Hebei does not adequately capture its regional characteristics. Studying Beijing, Tianjin, and Hebei as an integrated whole and using the Taihang and Yanshan mountains as natural geographical boundaries will deepen our understanding of the region’s overall dynamics. Moreover, the divisions used in scientific research differ from administrative boundaries. It is not entirely appropriate to segment regions based solely on administrative criteria. A comprehensive consideration of multiple factors, including history, culture, and human geography, is essential.

The Beijing-Tianjin-Hebei region, situated in the North China Plain and bordered by the Yanshan Mountains to the north, the Taihang Mountains to the west, and Bohai Bay to the east, features diverse topography including plains, mountains, plateaus, and hills. The plains cover approximately 37% of the region’s total area and act as the primary center for population and economic activities. Known as China’s "Capital Circle," the region includes Beijing, Tianjin, and 11 prefecture-level cities in Hebei Province. Key areas such as the capital Beijing, the municipality of Tianjin, and the cities of Baoding and Langfang in Hebei Province are central to its coordinated development efforts. As of October 2024, the Ministry of Housing and Urban–Rural Development, along with other departments, has recognized 310 villages in the Beijing-Tianjin-Hebei region in six batches of "Chinese Traditional Villages."

Data processing

According to the list of 8,155 traditional villages released, there are 310 villages in this region, accounting for 3.8% of the total. These villages are distributed across 13 municipal administrative regions (Fig. 1). Table 1 shows the data sources used in the study.

Fig. 1
figure 1

Distribution of the Beijing-Tianjin-Hebei region and six batches of traditional villages.Figures were drawn by authors, using ArcGIS 10.8(Ministry of Natural Resources,China.http://bzdt.ch.mnr.gov.cn/index.html).

Table 1 Data sources.

Methodology

Research framework

This study collected the latitude and longitude data of 310 traditional villages in the Beijing-Tianjin-Hebei region and used ArcGIS 10.8 for data analysis. First, nearest neighbor analysis was applied to characterize spatial distribution patterns; second, the Gini coefficient and Lorenz curve were used to assess spatial distribution uniformity; third, kernel density estimation and standard deviation ellipse were employed to examine spatial layout characteristics; finally, Moran’s Index was used to analyze spatial aggregation.

Subsequently, ArcGIS 10.8 was utilized to explore the overall correlations between natural, social, and cultural factors and the distribution of traditional villages. The global influence of each factor on the distribution of traditional villages was compared through OLS and Geodetector’s factor detection to evaluate the importance of each factor. GWR was then used to analyze the spatial heterogeneity of these factors, revealing how their effect intensities varied with spatial location. Meanwhile, Geodetector’s interaction detector was employed to assess synergistic effects between factors and to identify types of interactions, enabling a comprehensive analysis of the driving mechanisms of multiple factors on the distribution of traditional villages.

This approach ultimately explored the spatial distribution patterns in the Beijing-Tianjin-Hebei region in depth, providing a scientific basis for formulating protection and development policies for traditional villages. The research framework is shown in Fig. 2.

Fig. 2
figure 2

Technical route(Figure was drawn by authors) .

Methods

Standard deviation ellipse

The standard deviation ellipse is an ellipse centered on the mean of the data points and generated with the standard deviation of the data points on each coordinate axis as the major and minor axes. In the field of data analysis, how to better understand the distribution of data has always been an important issue. The standard deviation ellipse algorithm is an effective visualization method that can help us better understand the distribution of data, find outliers, determine reliable data ranges, etc28. The study employs the standard deviation ellipse in the “Directional Distribution” tool of ArcGIS 10.8, and inputs data from four periods sequentially for result analysis. This approach facilitates the analysis of changes in the spatial distribution of traditional villages in the Beijing-Tianjin-Hebei region across different time periods.

The formula for the standard deviation the x’-axis and y’-axis is:

$$SDE_{X} = \sqrt {\sum\nolimits_{i = 1}^{n} {\left( {X_{i} - \overline{X}} \right)^{2} } } \,\,SDE_{y} = \sqrt {\sum\nolimits_{i = 1}^{n} {\left( {y_{i} - \overline{Y}} \right)^{2} } } \,\,$$

Nearest neighbor index analysis

The nearest neighbor index serves as an indicator for measuring the spatial distribution patterns of geographic features. By comparing the actual data to that of a completely random distribution pattern using the nearest neighbor distance, the spatial distribution patterns of geographic elements can be categorized as clustered, uniform, or random29.

The calculation formula is:

$$ANN = \frac{{\overline{D}o}}{{\overline{D}E}}$$

Among them, \(\overline{D}o\) is the average between the measured elements and their nearest neighbor centroid distance:

$$\overline{D}o = \frac{{\sum\nolimits_{i = 1}^{n} {d_{i} } }}{n}$$
$$\overline{D}_{E} = \frac{0.5}{{\sqrt{\frac{n}{A}} }}$$

Lorenz curve and the Gini coefficient

The Lorenz curve is a graphical tool used to measure the degree of evenness in a distribution30. The greater the curvature of the Lorenz curve, the more uneven the distribution is. Conversely, the smaller the curvature, the more even the distribution becomes. The study uses the Lorenz curve to graphically illustrate the distribution of traditional villages among cities in the Beijing-Tianjin-Hebei region.

The Gini coefficient, proposed by statistician Corrado Gini and based on the Lorenz curve, measures the degree of inequality. It serves as a statistical tool for assessing the fairness of social income distribution31. According to international practice, a Gini coefficient of 0 indicates perfect income equality. A coefficient between 0 and 0.2 signifies highly equitable income distribution. Values between 0.2 and 0.3 indicate relatively equitable distribution, while those between 0.3 and 0.4 suggest a reasonably fair distribution. A coefficient between 0.4 and 0.5 indicates a large income gap, and a value greater than 0.5 signifies a huge income disparity. Traditionally, the Gini coefficient is used to measure the degree of inequality in income distribution, but in our study, we applied it to explore whether the distribution of the number of traditional villages among different cities in the Beijing-Tianjin-Hebei region is equal.

Moran’s index

The Moran’s index is divided into global Moran’s index and local Moran’s index. The global Moran’s index of a region is analyzed to assess whether spatial clusters or outliers exist in the study area32. When global analysis indicates autocorrelation, a local Moran’s index analysis is required to identify specific outliers or clustered areas.

The study investigates the formation mechanism of traditional villages among adjacent counties by using the ROOK method in GeoDa software to create a proximity weights matrix. This matrix defines the connections between areal features (counties) and analyzes the spatial pattern.

The calculation formula is:

$$I = \frac{{\sum\limits_{{{\text{i}} = 1}}^{{\text{n}}} {\sum\limits_{{{\text{j}} = 1}}^{{\text{n}}} {w_{ij} (x_{i} - \overline{x})(x_{j} - \overline{x})} } }}{{\sum\limits_{i = 1}^{n} {\sum\limits_{j = 1}^{n} {w_{ij} \sum\limits_{i = 1}^{n} {(x_{i} - \overline{x})^{2} } } } }} = \frac{{\sum\limits_{{{\text{i}} = 1}}^{{\text{n}}} {\sum\limits_{{{\text{j}} \ne i}}^{{\text{n}}} {w_{ij} (x_{i} - \overline{x})(x_{j} - \overline{x})} } }}{{S^{2} \sum\limits_{i = 1}^{n} {\sum\limits_{j = 1}^{n} {w_{ij} } } }}$$

Kernel density estimation

Kernel density estimation is a nonparametric statistical method used to estimate the probability density function underlying a data sample. According to the first law of geography33, each event can be considered a core element. In areas with a high number of events, the correlation among these core elements is stronger. Kernel density estimation embodies this concept through a function and visually represents it using relevant software34. The study employed kernel density analysis in ArcGIS 10.8 under “Spatial Analysis” to reveal the clustering of villages using the default search radius. It divided them into nine categories according to the natural breaks method and estimated the number and distribution characteristics of traditional villages in the Beijing-Tianjin-Hebei region.

Functional formula:

$${\text{f}}_{{\text{n}}} { = }\frac{{1}}{{{\text{nh}}}}\sum\limits_{{\text{i = 1}}}^{{\text{n}}} {\text{K}} \left( {{\text{X - X}}_{{\text{i}}} } \right)$$

OLS and GWR

OLS and GWR can explain and predict the impact of variables on the dependent variables. Unlike OLS regression, which has a constant fitting coefficient, the fitting coefficient in GWR models is a function of the geographic location of the sample point.

OLS: The most widely used least squares method, suitable for linear regression models35. The goal is to find a linear function that minimizes the sum of squared residuals between all observations and the predicted values of the linear function.

$${\text{OLS}}\,{\text{formula:}}\,{\text{y}}_{{\text{i}}} = \beta_{o} + \sum\nolimits_{k - 1}^{m} {\beta_{k} } x_{ik} + \in \left[ {1,n} \right]$$

GWR: In 1996, Professor A. Stewart Fotheringham of the University of St Andrews in the United Kingdom formally proposed the GWR mode36.

$${\text{GWR formula: y}}_{{\text{i}}} = \beta_{o} \left( {u_{i} ,\,v_{i} } \right) + \sum\nolimits_{k - 1}^{m} {\beta_{k} } \left( {u_{i} ,\,v_{i} } \right)x_{ik} + \varepsilon_{i}$$

Geodetector

The Geodetector method is a statistical approach that reveals the driving forces behind geographical phenomena by detecting the hierarchical heterogeneity of these phenomena. It can explain the spatial heterogeneity of geographical elements and analyze the interactions among different factors37.

The Geodetector is used to explore the spatial heterogeneity of the dependent variable Y. The Y value, as the dependent variable, changes with the variation in one or more explanatory variables. Therefore, the selection of the Y value should be related to the research objectives and capable of reflecting the spatial variation phenomenon in the study area. This study aims to explore the spatial distribution characteristics of traditional villages. For the selection of the Y value, an indicator is needed that can reflect the distribution pattern of the villages. Kernel density analysis effectively represents the distribution characteristics of villages. The study ultimately uses kernel density as the dependent variable and multiple driving factors as X values to evaluate the influence of each driving factor (X value) on kernel density (Y value).

Results

Overall distribution pattern and characteristics

Types of spatial distribution

There are three types of spatial distribution of villages: clustered distribution, random distribution and uniform distribution. As shown in Fig. 3, R = 0.427 < 1, the average observed distance is 7.369 km, the expected average distance is 17.252 km, and the absolute value of the Z-score is 19.29. The results show that the spatial distribution of villages in this region is a clustered distribution.

Fig. 3
figure 3

Nearest neighbor exponential analysis.Figure was drawn by authors, using ArcGIS 10.8

Distribution uniformity of traditional villages

The Lorenz curve deviates significantly from the even equilibrium line and exhibits a greater degree of curvature, indicating that the distribution of villages is uneven (Fig. 4). There are 250 villages in Xingtai, Shijiazhuang, Zhangjiakou, and Handan in Hebei Province, representing 81% of the total. In contrast, the remaining eight cities have fewer than 20 villages, indicating significant differences in their distribution.

Fig. 4
figure 4

Lorentz curve. Figure was drawn by authors, using Origin 2024.

Global Moran’s Index

Hebei Province has 167 counties; Tianjin has 16 districts; Beijing has 16 districts. There are 199 county-level government districts in this region, of which 42 have traditional villages.

Global spatial autocorrelation can determine the spatial correlation of villages38. The global Moran’s Index is 0.174, demonstrating that the overall distribution of villages in the Beijing-Tianjin-Hebei region is positively correlated. A p-value of 0.01 and a z-value of 3.74 indicate that the distribution in the area is not random but shows significant clustering characteristics.

Local Moran’s index

Since the Global Moran’s Index reflects the spatial differences of the entire region, it is difficult to show the spatial characteristics and relationships within this region39. Therefore, the analysis uses the Local Moran’s Index to further assess the local spatial characteristics of the spatial distribution of traditional villages. The region mainly exhibits high-high types, high-low types, and low–high types (Fig. 5). The specific descriptions are as follows:

Fig. 5
figure 5

Moran exponent.Map was drawn by authors, using GeoDa.

The high-high (H–H) type belongs to the "double-high" area with a high density of villages itself and high density in the surrounding areas, and exhibits strong spatial correlation among traditional villages. It is mainly distributed in Pingshan County, Luquan County, and the Jingxing Mining Area in Shijiazhuang, Xindu County and Shahe County in Xingtai, and Shexian County in Handan.

The low–high (L–H) type refers to areas with a low density of villages themselves and a high density in the surrounding areas. It is mainly distributed in Yangyuan County, Xuanhua County, and Zhulu County in Zhangjiakou, Zanhuang County and Yuanshi County in Shijiazhuang, and Xiangdu District in Xingtai.

The high-low (H–L) type refers to areas with a high density of villages itself and a low density of villages in the surrounding areas. It is mainly distributed in Zunhua County in Tangshan and Huailai County in Zhangjiakou.

In general, the spatial correlation of village density in the Beijing-Tianjin-Hebei region varies greatly, showing a certain degree of clustering and imbalance in spatial distribution. The overall characteristics are more obvious "high-high" clustering, while "low–high" and "high-low" clusters have a narrower distribution range.

Spatial layout of traditional villages

The standard deviation ellipse is applied to analyze the spatial patterns and evolutionary dynamics of geographical elements40. The ratio of the X-axis to the Y-axis is called the oblateness. The greater the oblateness, the more significant the directionality of the distribution trend of villages. Analyses show that after the Yuan Dynasty, the directionality of the distribution trend of villages became increasingly pronounced. Before the Ming Dynasty, the length of the short axis increased over time, and the centripetal force of the ellipse decreased, showing that the distribution of villages became more dispersed. After the Ming Dynasty, the length of the short axis decreased over time, and the centripetal force of the ellipse increased, and the distribution of villages became more concentrated. As shown in Fig. 6(a), the distribution of villages has exhibited a clear trend of gradual stabilization since the Ming Dynasty. Over time, the directionality of village distribution has become more apparent, the degree of dispersion has tended to stabilize, and villages have gradually been distributed along the Taihang Mountains.

Fig. 6
figure 6

(a) standard deviation ellipse; (b) kernel density estimation.Maps were drawn by authors, using ArcGIS 10.8

The kernel density estimation method was employed to examine the clustering and distribution characteristics of the villages. The overall distribution is uneven (Fig. 6(b)), with most villages distributed in the northern and central areas of the Beijing-Tianjin-Hebei region, while other areas are relatively scattered and have low density. The overall spatial layout is mainly composed of three high-density areas and three medium-density areas. The three high-density areas are located in the west of Shijiazhuang, at the junction of Xingtai and Handan, and south of Zhangjiakou. The medium-density area is positioned in the central part of the region.

Factors affecting spatial distribution

Influencing factor indicators

Based on the experience of previous researchers and in combination with the specific attributes of the study area, this study constructed a system of independent variables comprising ten indicators, including both natural and socio-economic factors, to serve as the basis for selecting influencing factor indicators, as shown in Table 2.

Table 2 Indicators of influencing factors.

Relationship between spatial distribution and natural factors

Altitude

Altitude affects climate conditions, vegetation cover, land use, and human activities. Studies have shown that changes in altitude are key determinants of climate suitability and ecological diversity. Therefore, altitude is an important indicator of the potential for human settlement and agricultural development.

The Yanshan Mountains run east–west and the Taihang Mountains run north–south; together, these mountain ranges converge to form the backbone of the Beijing-Tianjin-Hebei area, creating its most significant mountain landscape. This study selected altitude as the key indicator to analyze the impact of natural factors on village distribution.

The study used ArcGIS10.8 to extract the altitude data of villages and analyzed the average, minimum, maximum altitude and height difference of 310 villages to study the distribution pattern of villages at different altitude levels.

As shown in Fig. 7(a), villages are mainly distributed along the Yanshan-Taihang mountain range, while those in the North China Plain are more sparsely distributed. The results indicate that the average altitude of the 310 villages is 512 m, with an altitude range from the lowest at 4 m to the highest at 1620 m, totaling a difference of 1616 m. There are 42 villages below 200 m, accounting for 13.5% of the total, and these are relatively scattered across the plains. There are 130 villages between 200 and 500 m, representing 42% of the total, and 138 villages between 500 and 2000 m, accounting for 44.5% of the total, with a higher concentration in the hilly highlands. The villages are predominantly located in the hilly and mountainous areas of the Yanshan-Taihang Mountains in the northwest, yet they are relatively dispersed. The results indicate that village distribution diminishes with increasing altitude.

Fig. 7
figure 7

(a) Elevation; (b) Slope; (c) River buffer; (d) Temperature; (e) Rainfall.Maps were drawn by authors, using ArcGIS 10.8

Slope

Slope is a key topographic factor that affects land use type, agricultural sustainability, and soil erosion. Farming difficulty and soil erosion impact human settlement and ecological balance. Therefore, slope is an important indicator for assessing land suitability and environmental risks.

The slope of cultivated land is categorized into five levels, namely ≤ 2°, 2° ~ 6°, 6° ~ 15°, 15° ~ 25°, and > 25°. Different slope levels have different impacts on agricultural land use efficiency.

As the elevation increases, the number of villages gradually declines (Fig. 7(b)). In this area, nearly half of the villages have relatively steep average slopes. A total of 90 villages, accounting for 29.03%, are situated in regions with gentle slopes (≤ 2°) and generally have no soil erosion. A total of 181 villages are located in regions with relatively gentle slopes (2° ~ 15°), accounting for 58.39%, and are characterized by mild to moderate soil erosion, necessitating enhanced soil and water conservation efforts. As the average slope gradually increases, the problem of soil erosion becomes increasingly severe, and the number of villages also decreases. When the slope exceeds 15°, these villages account for 12.58% of all villages; the issue of soil erosion is already significant, and a series of comprehensive measures needs to be taken to prevent and control soil erosion. When the slope is greater than 25°, the strategy of gradually converting farmland to forestland should be considered.

Villages are predominantly located in regions with level terrain and gentle slopes. These areas provide favorable conditions for housing construction, production activities, agricultural operations, and daily life. For areas with steeper terrain, corresponding measures should be taken to minimize disturbance to the ecosystem and promote its recovery.

River factors

Rivers play a decisive role in the location of traditional villages, especially in areas with high water dependence and agricultural production. Rivers provide the necessary water resources to support agricultural irrigation and also affect flood risk management in the region. Therefore, it is necessary to use river factors as a key indicator for assessing the spatial distribution of villages.

According to relevant regulations, China’s water systems are divided into the following categories41: First-level water systems, mainly covering China’s large rivers, such as the Yangtze River and the Yellow River; second-level water systems, which usually refer to the main tributaries of the first-level water systems; third-level water systems, which mainly refer to the tributaries of the second-level water systems; fourth-level water systems, which usually refer to the tributaries of the third-level water systems, such as small rivers and streams; fifth-level and lower water systems, which mainly refer to the tributaries of the fourth-level water systems, such as ditches and artificial waterways. These water systems are relatively small in scale, and their main functions include irrigation, drainage, and flood prevention.

Beijing and Tianjin both belong to the Haihe River Basin, and all water systems in Beijing belong to the Haihe River Basin, with 91% of Hebei Province also belonging to this basin. The Luanhe River System is the second largest river system in Hebei Province.

The Beijing-Tianjin-Hebei region is frequently hit by floods. Floods in Beijing are mainly caused by the three major water systems: the Yongding River, Beiyun River, and Chaobai River42. Historical statistics show that the Yongding River had 81 breaches, 59 overflows, and 9 diversions in the 835 years from AD 1115 to 1949. From 1470 to 1948, the region experienced 43 floods that lasted for more than two years consecutively, totaling 122 years, with the longest consecutive flood record being 7 years. Tianjin, as the estuary where the five major river systems of the Haihe River converge, is a typical flood-prone area. According to historical documents, from AD 146 to 1854, there were 341 years affected by waterlogging, of which 85 were major floods, 50 years were characterized by drought but mainly waterlogging, and 7 years experienced severe drought and flooding. Particularly worth mentioning is the flood in 1939, which submerged Tianjin for a long time, lasting for 2 months, with the water depth in the streets reaching 2 m. Hebei Province has long been plagued by a variety of natural disasters, including floods, waterlogging, and droughts, with their severity and frequency being especially prominent. Due to the extremely uneven distribution of rainfall in the province, large-scale floods and droughts often occur alternately, significantly impacting the lives and production of local people.

By constructing a river buffer zone analysis model for this region, it was found (Fig. 7(c)) that there are 41 villages within a 500-m buffer distance, 14 villages within a 1,000-m buffer distance, 8 villages within a 1,500-m buffer distance, and 14 villages within a 2,000-m buffer distance. Additionally, the number of villages with a buffer distance greater than 2,000 m is 230, representing 74.2% of the total. These data show that most villages are located far from rivers. According to historical documents, these areas are prone to flooding. Therefore, maintaining a sufficient distance between villages and rivers is crucial to mitigate the impact of waterlogging disasters.

Temperature

Temperature suitability is a key factor in determining crop types and planting times, while extreme temperature conditions are particularly restrictive to agricultural production. The study utilized GIS technology to overlay temperature data with village location data, visually displaying the relationship between temperature and village distribution, and thus exploring its impact on spatial distribution.

The annual mean temperature in this region ranges from -1.5 °C to 15.4 °C (Fig. 7(d)). Extreme temperatures have a significant restrictive impact on agricultural production. The study found that 64 villages were situated in regions where the average annual temperature was below 10 °C, accounting for 20.65% of the total. Temperature conditions in most other villages are relatively suitable. Low-temperature environments significantly negatively affect crop growth43, which may cause the growth to be slowed or even stagnant, thereby affecting yield and quality. Suitable temperature conditions promote crop growth and development, while inappropriate temperatures can hinder it.

Rainfall

Precipitation directly affects agricultural irrigation demand, water availability, and flood risk management. In areas with limited water resources or uneven precipitation, it becomes an important factor affecting land use and agricultural planting choices. Therefore, analyzing precipitation is of great significance for studying the spatial distribution of villages in the Beijing-Tianjin-Hebei region.

The study utilized ArcGIS 10.8 to statistically analyze and calculate the annual average precipitation in each region, and matched these data with the geographical locations of the villages to evaluate the impact of precipitation on the distribution of villages.

As shown in Fig. 7(e), the annual precipitation in this region ranges from 280 to 717 mm. Among these, 10 villages are located in the semi-arid zone with an average annual rainfall of between 200 and 400 mm, representing 3.21% of the total. Most of the remaining villages are distributed in the semi-humid zone. The data in the figure indicate that rainfall affects the distribution of villages. Insufficient rainfall may lead to water shortages and have a negative impact on agricultural production, while excessive rainfall may enhance the potential for natural disasters such as floods.44.

Relationship between spatial distribution and social and cultural factors

Population

According to survey data, the population size of the Beijing-Tianjin-Hebei region has reached 110.37 million. The total population of the four cities of Beijing, Tianjin, Shijiazhuang, and Baoding is 58.2579 million, accounting for over 50% of the region’s population. In this region, the urban population totals 75.73 million, and the permanent population’s urbanization rate has climbed to 68.61%. At the same time, the ethnic minority population is 4.71 million, representing 4.27% of the total population. The western region has a relatively sparse population distribution due to its rugged terrain, particularly in the plateau and mountainous areas north and west of the Yanshan-Taihang Mountains.

A total of 127 traditional villages were identified within the population range of 400,000 to 500,000 (Fig. 8(a)). In the population range of less than 200,000, only one traditional village was found, while in the population range exceeding 1,000,000, there are only two traditional villages. In areas with small populations, the shortage of labor and capital restrict the construction and maintenance of villages. Relatively speaking, densely populated areas exhibit a higher degree of modernization, causing a comparatively smaller number of villages. Areas with a moderate population size are more beneficial to the protection and development of villages. Such areas provide the necessary labor and community functions, helping to preserve traditional villages without the adverse effects of excessive modernization.

Fig. 8
figure 8

(a) Population; (b) GDP; (c) GDP per capita; (d) Tourism resources; (e) Transportation conditions.Maps were drawn by authors, using ArcGIS 10.8

Based on the above analysis, extreme values of population density impact the geographical distribution. In densely populated areas, urbanization tends to be more pronounced, such as in all of Beijing and Tianjin, as well as in parts of Tangshan, Shijiazhuang, and Qinhuangdao in Hebei Province. In these areas, the acceleration of urbanization and modernization has had a substantial impact on traditional villages. Especially in Beijing, the national capital, the acceleration of industrialization and urbanization has intensified the conflict between village protection and development. In contrast, in sparsely populated, extremely low-density areas, such as in Jingxing County, a mountainous area within Shijiazhuang, most villages are surrounded by mountains, and villagers are scattered in basins at the foot of the mountains. These villages were formed as a result of historical wars and famines and have remained isolated from the outside world. Due to the difficult living conditions, sparse population, and scattered locations, these traditional villages have been well preserved.

GDP

GDP, as a core indicator for measuring the economic prosperity and level of development in a country or region, is of great significance for economic analysis of the region (Fig. 8(b)). The number of traditional villages in the lower GDP range (2.57 billion to 29.49 billion yuan) is relatively large, amounting to 231, representing 74.52% of the total. In the higher GDP range (88.48 billion to 1.10202 trillion yuan), the number of villages decreases significantly to 3. By observing the graphical data, we can clearly see that with the continuous growth of GDP, the number of villages has dropped significantly. Economic growth is usually accompanied by accelerated industrialization and urbanization, which leads to a substantial number of rural people migrating to cities, thereby causing the gradual decline and even extinction of traditional villages. In addition, economic growth may also lead to over-exploitation of natural resources and environmental damage. This will further increase the difficulty of protecting traditional villages and cause relatively greater damage to them.

GDP per capita

GDP per capita, as a key indicator for measuring a country or region’s economic development level and the affluence of its inhabitants, is a more accurate and representative measure than total GDP45. As shown in Fig. 8(c): the GDP per capita distribution across counties and districts in the Beijing-Tianjin-Hebei region is as follows: 90 traditional villages are located in the lower range (GDP per capita between 20,000 yuan and 44,400 yuan), representing 29.03% of the total; 219 traditional villages are located in the medium-to-high range (GDP per capita between 44,400 yuan and 110,000 yuan), accounting for 70.97% of the total; and no traditional villages are found in the higher range (GDP per capita exceeding 110,000 yuan). The results clearly demonstrate that regional economic imbalances have influenced the distribution pattern.

Tourism resources

Exploring the distribution of tourism resources within the village will help reveal the potential for tourism development and promote both its sustainable development and cultural heritage protection. There are two opposing views on the protection of cultural heritage. One view is that tourism development is a key way to revitalize the culture of traditional villages; the other view is that tourism development has a negative impact on the cultural protection of traditional villages46 and may lead to the utilitarianization of interpersonal relationships in the village, the commercialization of culture, and the degradation of cultural landscapes. However, in actual operation, there is complementarity between the cultural protection of traditional villages and the use of tourism resources. As long as a balance can be found between the two, tourism can fully leverage its positive role in the protection and utilization of traditional village culture if properly managed.

According to the latest statistics released, there are 853 A-level tourist attractions, including 526 in Hebei Province, 104 in Tianjin, and 223 in Beijing47,48,49. As shown in Fig. 8(d), after an in-depth analysis of these data, we can clearly observe that Tianjin and Beijing exhibit extremely high tourism resource intensity, with Hebei Province also displaying relatively high resource intensity.

Most traditional villages are well-preserved, boasting rich tourism and cultural resources with significant potential for tourism development. These villages are unique in architectural style and layout and also hold significant value in folk culture and historical heritage. The development of tourism can effectively promote the protection and inheritance of these village cultures, allowing more people to understand and appreciate this unique cultural heritage50. However, due to various factors such as natural erosion, human destruction, and a lack of effective protection measures, the original appearance of some of these traditional villages has gradually become blurred. At the same time, some precious folk cultures are gradually disappearing, leading to a loss of their original tourist appeal. Consequently, it is difficult for these areas to effectively protect and inherit village culture through the development of tourism.

Transportation conditions

Road construction has significantly improved the transportation accessibility of traditional villages, which has far-reaching significance for enhancing village infrastructure. With the gradual convenience of transportation, the villagers’ travel conditions have significantly improved, freeing them from the constraints of previous transportation inconveniences51. The introduction of modern resources and facilities will gradually promote economic prosperity, and convenient transportation also promotes the vigorous development of tourism, contributing to the overall economic prosperity.

As shown in Fig. 8(e), the majority of villages in the Beijing-Tianjin-Hebei region are effectively located within the buffer zones of national, provincial, and county roads. Specifically, within the 1,000-m buffer zone, a total of 139 villages are covered; within the 2,000-m buffer zone, the number of covered villages is 60. These data clearly demonstrate the key role of transportation conditions in enhancing village accessibility and promoting economic development.

Limitations in selecting influencing factor indicators

Regarding the research parameter system, the article mainly focuses on directly quantifiable geographical and climatic factors, as well as some economic and cultural factors, but it does not fully cover all factors affecting regional development. In particular, factors such as land use changes, historical policy interventions, and urbanization trends also affect the long-term development of the region. The study should also discuss qualitative factors such as intangible heritage, which cannot be quantified but have an impact on village development. For example, the impact of religious culture, historical policies, and land use changes could enrich the analysis of cultural impacts, while also facilitating discussion on these non-quantifiable factors.

Religious culture is one of the cultural elements, but because it covers a narrow scope and cannot constitute an important factor in analyzing the spatial distribution of traditional villages, this article does not include religious culture among the driving factors. Among the 310 traditional villages in the Beijing-Tianjin-Hebei region, only a very small number are located around temples or Taoist temples, and some villages also have small temples for villagers to worship. For example, the “Shousheng Temple” in Wangli Village (formerly known as Wanger Village) in Jingxing County, Hebei Province, is a small temple that was spontaneously built by villagers during the Ming Dynasty.

Regarding historical policies, the author has paid attention to this aspect during his research. The most distinctive policy can be traced back to the early Ming Dynasty. Because Beijing was sparsely populated after the war, the court began to implement an immigration policy. According to historical records, large-scale immigration activities were organized several times during the Ming Dynasty. These activities were mainly in Hongdong County, Pingyang Prefecture, Shanxi Province, known as the "Hongdong Immigration." Some people moved to Beijing, Tianjin, and 129 counties in Hebei. Some of the traditional villages in Beijing, Tianjin, and Hebei originated from migrations from surrounding provinces in the early Ming Dynasty. However, such historical records are too subjective and difficult to quantify in research. In our study, we did not explore these factors in depth, but we recognize their importance. Future research will attempt to explore how these cultural factors specifically affect regional development and residents’ lives through case studies and other methods to supplement the existing quantitative analysis.

In terms of land use, northern villages differ from southern villages. In the Yellow River Basin, northern villages are mainly concentrated settlements where farmland and farmhouses are closely connected. The fertility or barrenness of farmland influences the distribution and development of villages. Compared with the fertile soil in the south, the quality of the land in the north is relatively poor, and the population in the villages is not as large as in the south. Taking Zhengding County in Hebei Province during the Ming and Qing Dynasties as an example, most villagers would live in villages with fertile land, which offered higher income and profit. The amount of land cultivated was closely related to the amount of silver earned. Similarly, this type of research is not easy to quantify, and since the Beijing-Tianjin-Hebei region is located in the north, the differences within the region are not pronounced.

Analysis of spatial heterogeneity of traditional villages

Geodetector analysis

Univariate analysis

Ten independent variables were selected for analysis, and their scores are as follows: the altitude (X1) in the traditional village area is divided into five levels; the slope (X2) in the traditional village area is divided into five levels; the buffer distance between the traditional village and the river (X3) is classified into five divisions at intervals of 0.5 km; the transportation network analysis (X10) is divided into three categories with a buffer zone of 1 km; temperature (X4), rainfall (X5), population (X6), GDP (X7), GDP per capita (X8), and tourism resources (X9) are divided into nine categories according to natural breakpoints.

The factor detectors are ranked by their explanatory power: rainfall (X5) > GDP per capita (X8) > transportation conditions (X10) > tourism resources (X9) > slope (X2) > population (X6) > GDP (X7) > river buffer (X3) > temperature (X4) > altitude (X1)37.

The smaller the p-value, the stronger the evidence that the independent variable X impacts the dependent variable Y, indicating higher reliability for this inference. As shown in Fig. 9(a), rainfall X5 (0.003), population X6 (0.074), and transportation conditions X10 (0.071) are influencing factors with relatively small p-values, indicating a significant effect on the spatial distribution of villages. Altitude (X1), slope (X2), river buffer (X3), temperature (X4), and GDP (X7) exhibited relatively weaker explanatory power.

Fig. 9
figure 9

Geodetector factor detection results: (a) single factor detection results; (b) interaction detection results. Figures were drawn by authors.

Factor interaction detection

In the process of exploring the relationships among multiple factors, there are varying degrees of connection between these factors. To accurately assess the roles of these factors in explaining spatial differences, this study applied the interactive detection module within the Geodetector. The study focused on two specific factors, A and B, comparing their impacts on traditional villages. It aimed to determine whether these factors act independently on the spatial distribution of villages or interact in a joint manner.

As an effective analytical tool, the interaction detector can help us identify interactions between different explanatory variables37. To thoroughly explore the interactions between these factors, interaction detectors were further utilized for more precise analysis, as shown in Fig. 9(b). The interaction between GDP and population (q = 0.90) is the foremost driving force, followed by the interaction between GDP and rainfall (q = 0.88), the interaction between population and river buffer (q = 0.85), the interaction between GDP and river buffer (q = 0.79), and the interaction between transportation conditions and population (q = 0.77).

According to the analysis results, spatial heterogeneity is influenced by the interactions among multiple factors, including population, economy, and environment. The interaction effects are significantly stronger than those of any single factor, revealing the key driving mechanisms behind the formation of spatial patterns.

OLS and GWR model analysis

The study employs the OLS method to quantify global spatial relationships and utilizes the GWR model to analyze spatial heterogeneity by calculating the local regression coefficients (LRC) that relate the spatial distribution of local regions to influencing factors52.Before conducting the GWR analysis, the spatial autocorrelation of the kernel density was assessed to establish the presence of spatial dependence.

OLS analysis

The study uses the kernel density estimate of villages as the dependent variable Y, and altitude (X1), slope (X2), river buffer (X3), temperature (X4), rainfall (X5), population (X6), GDP (X7), GDP per capita (X8), tourism resources (X9), and transportation conditions (X10) as independent variables X.

The Pearson correlation coefficient (r value) measures linear correlation, ranging from -1 to 153. R-squared (COD) refers to the indicator for determining the goodness of fit of the linear regression line.

There are significant correlations between traditional village kernel density estimates and eight factors. Altitude (X1), temperature (X4), rainfall (X5), and tourism resources (X9) (p < 0.05, r > 0) are positively correlated with the kernel density of the region. These factors significantly influence the distribution of village kernel density. Population (X6), GDP per capita (X8), GDP (X7), and transportation conditions (X10)(p < 0.05, r < 0) are negatively correlated with the kernel density of the region. The slope (X2) and river buffer (X3)(p > 0.05) show no significant correlation with the kernel density in this region. The analysis results do not account for spatial heterogeneity. R-squared (COD) generally fails to adequately explain the spatial distribution, indicating that further analysis is required. Based on linear regression analysis, two non-significantly related influencing factors were eliminated. A local spatial regression model based on GWR was further constructed, as shown in Table 3 and Fig. 10.

Table 3 Results of OLS analysis.
Fig. 10
figure 10

OLS linear regression analysis. Figures were drawn by authors.

GWR analysis

There are significant spatial clustering and autocorrelation in the spatial distribution of villages (Moran’s Index = 0.174 > 0, Z = 3.74). The GWR model increases the R2 value (OLS: 0.449; GWR: 0.473) and reduces the bandwidth and AICc values (OLS: 1766.78; GWR: 1752.50), confirming the influence of spatial heterogeneity.

Because the VIF values of altitude, GDP per capita, and transportation conditions are greater than 7.5, there is multicollinearity that needs to be addressed. Temperature, rainfall, tourism resources, population, and GDP were selected as factors influencing the local spatial heterogeneity of the spatial distribution, as shown in Fig. 11. The average absolute value of the LRC for each influencing factor indicates their overall contribution to the protection of the cultural heritage. The local spatial impact intensity of the five factors is as follows: temperature has the largest overall contribution (|LRC|= 2.03837), followed by tourism resources (|LRC|= 1.79494), rainfall (|LRC|= 0.20169), GDP (|LRC|= 0.00430), and population (|LRC|= 0.00047). Additionally, by combining the LRC values with spatial distribution, the influencing factors are categorized into two types: positively correlated areas (LRC > 0) and negatively correlated areas (LRC < 0), as illustrated in Fig. 8.

Fig. 11
figure 11

Spatial distribution of LRC calculated by the GWR model. Maps were drawn by authors, using ArcGIS 10.8

According to the analysis of the temperature regression coefficient diagram, temperature has a significant positive impact. Temperature factors affect the economic foundation of villages by influencing the growth cycle of crops, becoming one of the key factors in village distribution. However, this impact varies in different regions, with its negative impact gradually decreasing from northeast to southwest. There are three high-density clusters of traditional villages in the southwest region, and the negative impact of temperature on the area is relatively weak.

Analysis of the distribution of scenic spots in the region shows that there is a positive correlation between the distribution of scenic spots and villages, with the degree of influence decreasing from southwest to northeast. High-value areas are focused on Handan, Xingtai, and Shijiazhuang, while low-value areas are focused on Chengde, and Qinhuangdao. There are high-density clusters of villages in the southwest, whereas regions in the north, such as Zhangjiakou and Chengde, exhibit relatively simpler tourism development and protection measures, with their historical heritage not being as rich as that of Handan and other places.

The analysis of the rainfall regression coefficient diagram shows that rainfall promotes the clustering distribution of traditional villages, with this effect decreasing from southwest to northeast. The impact on the three high-density clustered areas of villages is higher than that in other areas. The GDP regression coefficient diagram shows that there is a negative correlation between economic growth and the distribution of villages, with the degree of influence decreasing from northeast to southwest. The regions with the highest degree of influence are mainly Qinhuangdao and Chengde, which are economically at a medium level, while the regions with lower degrees of influence are mainly in Handan and Xingtai, which are economically less developed and more suitable for the distribution of villages. The more developed the economy is, the less favorable it is for the distribution of villages, and overdevelopment may cause damage to villages. Similarly, increases in population density are unfavorable to the distribution of villages, with the degree of this impact decreasing from northeast to southwest, indicating a negative correlation.

Discussion

Traditional villages emerge from the prolonged interplay between human activities and the natural environment. They record information on the social economy, politics, culture, and folk customs of the time from multiple perspectives54. As villages with a long history, these villages not only contain rich traditional resources but also demonstrate significant historical, cultural, and economic value.

Across the vast land of China, different cultural and historical backgrounds have given rise to a variety of village types. On the Qinghai-Tibet Plateau55, Tibetans, influenced by Tibetan Buddhism for thousands of years, have developed a typical social structure. In the western Sichuan plain56, Linpan villages demonstrate how to adjust living spaces to achieve thermal comfort according to different climatic conditions, providing important guidance for the reconstruction and restoration of villages in the region. Villages in the Bohai Rim region exhibit significant spatial differences in distribution and degrees of dynamic change57, while villages in the southeast coastal area are primarily influenced by cultural factors18.

Particularly, the traditional villages in the Beijing-Tianjin-Hebei region are rich, diverse, and have distinct cultural characteristics. As a high-density cluster of villages, they demonstrate high research value. However, previous studies on villages in this region have been limited to small scopes or a single perspective, lacking comprehensive and integrated analysis. Therefore, this study focuses on analyzing the distribution patterns of villages and their influencing factors, to provide theoretical support for the conservation and inheritance of villages.

Comprehensive analysis of driving factors

Historical culture is the core factor

Shijiazhuang, Xingtai, Handan, and Zhangjiakou, four cities where traditional villages account for more than 15%, were selected as research objects. Statistical analysis was conducted by collecting data from various districts and counties in these cities (Table 4). Most of the villages originated in the Yuan, Ming, and Qing dynasties, and some can even be traced back over 600 years. For these villages with a long history, the initial reasons for their establishment are often difficult to verify accurately through historical documents, and only limited information can be obtained through historical relics such as inscriptions and temples preserved in the villages. During a survey of some villages in Jingxing County, Shijiazhuang, it was found that a few villages still retained some inscriptions, most of which date from the Qing Dynasty, while those from the Ming Dynasty are relatively few. In addition, there are temples in a few villages. Most of these temples are built by the villagers themselves for worship. For relatively new villages, most were formed naturally or due to population migration, and only a few were due to wartime migration. In terms of topographical features, most of these villages are located in hilly and mountainous areas, while there are fewer basins and rivers. The historical background of war and escaping from chaos, as well as the geographical environment, have jointly shaped the characteristics of traditional villages and nurtured their unique cultural customs, thus forming traditional villages with regional characteristics58. At the same time, traditional villages have nurtured many precious cultural heritage items in the course of their long-term development. These cultural heritage items have evolved into valuable wealth over time, which is also the value of the inheritance and protection of villages59.

Table 4 Village information.

The important role of natural socio-economic factors

With the continuous advancement of modernization, the protection and development of traditional villages also face certain challenges in the pursuit of economic benefits and the implementation of large-scale urban expansion60. When GIS was used to correlate the geographic information of natural elements with the distribution characteristics of villages, the analysis revealed that the distribution was significantly affected by natural elements. When analyzing altitude, rivers, slopes, climate, etc., it was found that in areas with favorable natural conditions, the number of villages is greater, and the density is higher, with most exhibiting a clustered pattern of spatial distribution61. Using GWR to analyze the GDP of each county in the region, the analysis shows that economic growth is negatively correlated with the distribution of villages. Areas with a high density of traditional villages are mainly those with relatively underdeveloped economies, which reflects, to some extent, that the spatial distribution of villages is partially affected by the level of economic development in the region60. Using Geodetector for interaction analysis, the analysis indicates that economic impact is inseparable from population impact. Both exhibit significant non-linear growth62.

Protection and development strategies

Traditional villages in the Beijing-Tianjin-Hebei region are influenced by a variety of factors, including the natural environment and socioeconomic factors. Based on the importance of these influencing factors for the spatial distribution pattern, this study proposes corresponding protection strategies. Research analysis shows that population and economic factors are negatively correlated with village distribution. The three high-density areas and three medium-density areas in the overall spatial layout are all located in areas with lower economic development levels. Examples include Jingxing County in Shijiazhuang, as well as Xingtai and Handan in Hebei Province. There is a positive correlation between the natural environment and village distribution. The areas where traditional villages are located have rich cultural heritage and pleasant natural conditions, which have ensured the ongoing development and clustering of villages over the past hundreds of years. Based on these influencing factors, this study proposes corresponding protection strategies.

In highly urbanized areas such as Beijing and Tianjin, a strategy that prioritizes conservation and development as a complementary approach should be adopted. Economic development has led to the concentration of population and resources in cities, leading people to migrate from rural areas, forming a “hollowing out” phenomenon. During the investigation, we found that the aging problem in traditional villages has worsened and the demographic structure of rural communities has changed significantly. Therefore, in these economically prosperous areas, it is particularly important to adopt a strategy centered on protecting traditional villages, supplemented by moderate and controlled development.

In some areas with low economic development, backward economic conditions have led to villages being inadequately protected. For such villages, we rationally plan and restore them without damaging the overall form, improving their livability and environmental quality, and enhancing living comfort. At the same time, by introducing advanced technology and modern concepts, we nurture new vitality. We use the rich historical culture and natural resources of the countryside to vigorously develop tourism, realize the dynamic and organic combination of traditional elements and modern functions, and pragmatically achieve “activated” utilization rather than passive preservation.

In some high-density areas, traditional villages are well preserved, but indicators such as population, river distribution, transportation network, and total GDP show that villages have issues such as population decline and reduced economic vitality. Based on the analysis of geographic detectors (interaction between GDP and population (q = 0.90); population and river buffer (q = 0.85); GDP and river buffer (q = 0.79); transportation conditions and population (q = 0.77)), it is evident that the spatial heterogeneity of villages is influenced by the interaction of comprehensive factors such as population, economy, and environment. When formulating protection strategies, the impact of comprehensive factors, including population density and economic environment, should be comprehensively considered.

Limitations

In addition, this study still has some shortcomings. For example, when using Kernel density estimation to analyze the macro spatial pattern of traditional village distribution, the default bandwidth of ArcGIS 10.8 was used, which utilizes the spatial variable of the "Silverman empirical rule" to calculate the default search radius. Although it is suitable for large-scale areas for macro pattern exploration with large sample sizes, it still has limitations: the lack of quantitative bandwidth comparison and verification may lead to insufficient local cognition. The next step will be to conduct a comparative analysis based on two commonly used quantitative methods in analyzing bandwidth, the Silverman rule of thumb and the cross-validation method, to further optimize the bandwidth selection. When applying the Moran’s Index method for analysis, ROOK adjacency is used instead of other methods, such as Queen adjacency. Although this study investigates the formation mechanism of adjacent counties of traditional villages, counties are closed surface elements, and their spatial interaction depends on the actual geographical border relationship. The study selected the ROOK rule to construct a weight matrix through topological adjacency, which strictly limits "only counties that share boundaries as neighbors" to define the basis of spatial connection. However, there are still limitations: different methods should be selected for different research objectives. Compared with Queen adjacency, ROOK adjacency is more suitable for administrative division characteristics, avoids interference from subjective distance parameters, and can ensure that the conclusions reflect the real boundary driving mechanism. This selection method is somewhat subjective, and when selecting a method, an in-depth analysis of the research objectives should be conducted to obtain more accurate conclusions.

Conclusion

This study systematically analyzes 310 "Chinese Traditional Villages" in the Beijing-Tianjin-Hebei region, expanding the understanding of traditional village research and exploring their spatial distribution and driving mechanisms. The following are the main conclusions and their connections to the global SDGs:

(1) The traditional villages in the Beijing-Tianjin-Hebei region are clustered around "three high-density areas" and "three medium-density areas," which are closely related to geographical, economic, and social factors. This distribution reflects the cultural diversity and ecological integrity of the region and is also an important manifestation of social cohesion. This echoes the vision of "Sustainable Cities and Communities" advocated by the United Nations SDG 11.

(2) By using a geodetector, the study revealed the significant impact of rainfall and per capita GDP on the spatial distribution of traditional villages. The interactions between these factors, such as total GDP and population (q = 0.90) and total GDP and rainfall (q = 0.88), indicate that the synergistic effect of economic conditions and natural resources has a decisive influence on village distribution. The study used the GWR model to reveal the significant spatial heterogeneity of the distribution of traditional villages and their influencing factors. For example, the positive impact of temperature and tourism resources on village distribution, and the negative correlation between population and GDP, the local differences in these factors emphasize the need for region-specific strategies. This multi-dimensional interaction mechanism not only provides a new perspective for understanding the spatial distribution of traditional villages, but also provides a scientific basis for formulating regionally targeted protection and development strategies.

(3) The study provides a broader perspective for understanding and addressing the challenges of globalization and urbanization through comparisons with the Italian Alps and rural India. The effectiveness of this approach highlights its potential application in rural conservation and development in other developing countries.

The research results not only provide specific strategies for village protection in the Beijing-Tianjin-Hebei region but also provide a reference for sustainable development and cultural heritage protection in similar regions around the world.