Introduction

Nonpoint source pollution (NPSP) is characterized by wide dispersion, complex migration routes, and low concentrations, posing significant and challenging issues for water environment research (Hou et al. 2022). To mitigate the effects of NPSP on water quality, riparian buffer zones are employed to effectively limit the flow of pollutants, including nitrogen and phosphorus, from runoff into receiving waters (Yang et al. 2016; Graziano et al. 2022; Xu et al. 2021). The Ministry of Environmental Protection of the People’s Republic of China has recognized the importance of protecting riparian buffer zones and restoring aquatic vegetation to augment ecosystem integrity at the regional scale. The efficiency of riparian buffer zones critically hinges on their width. Specifically, a greater buffer zone width leads to a more substantial purification effect under similar environmental conditions (Li et al. 2020; Sirabahenda et al. 2020; Wang et al. 2020). Therefore, accurately and reasonably determining the width of a riparian buffer zone is essential for optimizing its pollutant removal ability.

Numerous researchers, both domestically and internationally, have conducted extensive studies on the optimal width of riparian buffer zones. Some researchers have suggested that widths between 30 and 60 m could provide more than 50% efficiency of sediment runoff interception, coupled with good nitrogen and phosphorus absorption effects (Stott 2021; Gene et al. 2019; Hilary et al. 2021). However, the optimal width of a riparian buffer zone varies significantly across regions due to varying natural conditions, such as geographical location, soil physical and chemical properties, slope, and the range of water‒land interactions (Phillips 1989; Lee et al. 1989; Lind et al. 2019). Therefore, when planning a riparian buffer zone while exploring its pollution purification capacity, attention should be given to the local functional requirements of the waters. Given different functional requirements, the corresponding safe width of the buffer zone also varies. As such, determining the scientifically and reasonably appropriate width of the buffer zone requires meticulous scientific research on the site and comprehensive consideration of the relationship between the target waters and buffer zone.

With the gradual development of nonpoint source pollution models, several hydrological models applicable to different watershed scales have emerged. The models include HSPF, SWMM, ANSWERS, HBV, and SWAT (Ruan et al. 2020; Lai et al. 2022; Xue et al. 2022; Deval et al. 2022; Yuan and Koropeckyj-Cox 2022), the Soil and Water Assessment Tool (SWAT) is notably GIS-based, and simulations are possible at various time scales using long-term data series (e.g., weather data, river network data, and agricultural management measures). Model simulations cover both large- and small-scale watersheds and enables the assessment of the impact of agricultural management practices, land use, and water resources on pollution loads. The model also provides accurate quantitative calculations of nonpoint source pollution loads in watersheds (Busico et al. 2020; Jou et al. 2019; Chen et al. 2021; Shrestha et al. 2021). In addition, the SWAT model, as a mechanistic model, considers the complex migration and transformation processes of nonpoint source pollution, and the simulation results are more reliable compared to those of traditional empirical formulas.

The Ziwu River is a crucial water source for China’s “South-to-North Water Diversion West Route Project,” and it is of the utmost importance to scientifically and reasonably plan the width of the riverbank buffer zone to ensure the safety of its water quality. As such, the present study utilized the SWAT model to calculate the nonpoint source pollution load from the riparian buffer zone in the upper and middle reaches of the Ziwu River. The analysis involved examining the distribution of the nonpoint source pollution load in the buffer zone in different periods, calculating the pollutant concentration of the surface runoff at the riparian buffer zone’s edge via an empirical formula, and determining the safe width of the riparian buffer zone by combining the upper, middle, and lower basin’s water quality requirements. Additionally, correlation analyses identified the key factors influencing the safe width of the riparian buffer zone in the upper and middle reaches of the Ziwu River. This study serves to maximize the buffer zone’s coverage, minimize the direct entry of nonpoint source pollution into surface waters, establish a favorable habitat for local wildlife, improve biodiversity, and provide scientific guidance for preventing and controlling water pollution in the basin.

Materials and methods

Study area

The Ziwu River is situated at the junction of Hanzhong City and Ankang City in Shaanxi Province, at coordinates 33°18′–33°44′N, 107°51′–108°30′E. It functions as the primary tributary on the left bank of the Hanjiang River. It originates from the Qinling Mountains in Ningshan County and comprises the Wenshui River as the main stream, along with two tributaries, the Puhe River and Jiaoxi River. These three rivers converge at Sanhekou in Foping County, proceeding southward through the borders of Ningshan County and Foping County to the Liang River in Shiquan County before draining into the Han River near Baishadu. The main stream of the river spans 153.8 km and has a watershed area of approximately 3028 km2, characterized by mostly mountainous terrain and valleys (Fig. 1). The Ziwu River basin is in monsoon climate within the northern subtropical mountain-type and warm temperate humid-type climates, with varying climate characteristics due to the peculiar geographical location. Specifically, precipitation generally decreases in a south-to-north and west-to-east pattern. The average annual rainfall in the southern study area is 901 mm, and the average yearly temperature is 14.5 °C. In comparison, the northern area has an average annual rainfall of approximately 806 mm and an average annual temperature of 12.3 °C (National Bureau of Statistics 2020).

Fig. 1
figure 1

Geographical location of the upper and middle reaches of Ziwu River

Data collection and processing

The analysis of riparian buffer zone patterns used Landsat 8 OLI_TIRS imagery downloaded from the Geospatial Data Cloud (http://www.gscloud.cn/search) for November 2018. Field data were collected by the research team during two periods, from September 7 to 11, 2020, and from April 26 to 30, 2021. The sampling locations were selected using the typicality principle, as well as a combination of OMAP technology, remote sensing images, and GPS technology. This ensured a random distribution of the samples across the study area.

The SWAT model requires various input data, as summarized in Table 1. Four weather stations (Foping, Shiquan, Ningshan, and Yang) provided daily meteorological data from 2009 to 2021, which served as the model’s driving data. Land use data downloaded from the Resource and Environmental Science Data Center of the Chinese Academy of Sciences at a spatial resolution of 250 m × 250 m (Fig. 2a) and soil data obtained from the World Soil Database HWSD (Fig. 2b) were used as inputs. Water quality and runoff data were collected through field monitoring between 2018 and 2021. Physical and chemical soil properties were calculated using the soil‒plant–air‒water (SPAW) model or by querying HWSD’s attribute table to determine soil properties by layer. The upper and middle reaches of the Ziwu River have no significant point source pollution from industry; instead, the primary sources of pollution are agricultural nonpoint source pollution and some domestic sewage from villages and towns. Crop-specific input data (e.g., fertilizer and pesticide application rates) were used to simulate agricultural pollution for corn, rice, wheat, and soybean. See Table 1 for more information on the data sources.

Table 1 SWAT model input data
Fig. 2
figure 2

Land use (a) and soil types (b) in the upper and middle reaches of the Ziwu River

Analytical method for the spatial pattern of the riparian buffer zone

In this study, the Landsat 8 OLI_TIRS image served as the fundamental data source, with R, G, and B bands of 5, 6, and 2, respectively. The image underwent radiometric calibration to reduce the error originating from the sensor. To calibrate the remote sensing image, the FLASSH Atmospheric Correction Model of ENVI 5.3 software was utilized. The calibrated image was saved in TIFF format and cropped afterward. To make full use of the rich spectral information and high resolution of the Landsat 8 OLI_TIRS image, the pans sharpening parameters of multispectral images and panchromatic band images were also calibrated through ENVI 5.3 software. This step resulted in a complete remote sensing image covering the study area with multispectral information and a 15 m resolution. The upper and middle reaches of the Ziwu River were then supervisedly classified into categories utilizing the selected samples and the random forest classification tool of ENVI software, with a consequent spatial pattern of the riparian buffer zone distribution being obtained. The study quantitatively evaluated the applicability of the random forest model in riparian buffer zone identification by calculating the overall accuracy, kappa coefficient, user accuracy, and producer’s accuracy of the model. An accuracy over 75% for the overall accuracy, producer’s accuracy, and user accuracy, as well as a kappa coefficient closer to one, translates into better classification outcomes (Xu et al. 2022; Li et al. 2021a). The obtained index values from Formulas (1) to (5) are 90%, 0.864, 89.4%, and 90.8%, indicating the effectiveness of the random forest classification method to identify the riparian buffer zone in the upper and middle reaches of the Ziwu River.

$${p}_{c}=\frac{{p}_{y}}{p}\times 100\mathrm{\%}$$
(1)

where pc is the overall accuracy; py is the total number of correctly classified samples; and p is the total number of samples.

$$Kappa=\frac{p\times {p}_{y}-P}{{p}^{2}-P}$$
(2)
$$P=\sum_{i=j=1}^{n}{p}_{+j}\times {p}_{i+}$$
(3)

Please check if all equations are presented correctly.where P is the total number of products.

$${p}_{A}=\frac{{p}_{jj}}{{p}_{+j}}\times 100\mathrm{\%}$$
(4)

where pA is the producer’s accuracy; the number of samples of class j are those whose measured data are consistent with the classification results; and p+j is the total number of class j samples actually observed.

$${p}_{u}=\frac{{p}_{ii}}{{p}_{i+}}\times 100\mathrm{\%}$$
(5)

where pu is the user accuracy; pii is the number of class i samples whose classification results are consistent with the actual observations; and pi+ is the total number of class i samples in the classification results.

Simulation of the nonpoint source pollution load in riparian buffer zone

The SWAT model, developed by American scholar Jeff Amold, is a distributed model with physical mechanisms that can simulate water and soil at different temporal and spatial scales (Li et al. 2021b; Zuo et al. 2022; Zhang et al. 2020). In this study, the Sanhekou Water Control Project was chosen as the basin’s outlet. The threshold value for the basin was set at 6646 hectares, which is approximately 3% of the total study basin area. The upper and middle reaches of the Ziwu River were divided into 17 subbasins. Based on the subwatershed division, similar land use types, soil types, and slope plots in the watershed were divided into hydrological response units (HRUs), which significantly improve the predictive accuracy of the model (Azimi et al. 2020). This study divided the watershed in the upper and middle reaches of the Ziwu River into 252 HRUs by setting the thresholds for land use, soil type, and slope at 10% for HRU analysis. We inputted meteorological, soil type, and land use data, among others, to build the SWAT model and calculated the runoff and pollution load in each HRU. The SUFI-2 algorithm in SWAT-CUP software was used for sensitivity analysis of SWAT model parameters, where we selected parameters with high sensitivity for subsequent model parameter calibration and verification. The calibration period of the model was between 2018 and 2020, and the verification period was in 2021.

To enhance the evaluation of the model’s simulation performance, this study computed the relative error (RE), certainty coefficient (R2), and Nash coefficient (Ens). This comprehensive evaluation approach aimed to reduce the limitations in the model assessment. Some scholars have suggested that for the model to have an acceptable simulation performance on runoff, R2 should be at least 0.5, Ens should be greater than 0.5, and |RE| should not exceed 25%. For water quality simulation, an |RE| value less than or equal to 70% is considered adequate (Malik et al. 2022; Taghvaye Salimi et al. 2016; Koycegiz and Buyukyildiz 2019). An Ens value close to 1 indicates high prediction accuracy, while an Ens value lower than 0 indicates that the model’s prediction result is unreliable (Dakhlalla and Parajuli 2019; Tufa and Sime 2021; Ndhlovu and Woyessa 2021).

Analysis of pollutant concentration in surface runoff

The concentration of pollutants in surface runoff as it nears the edge of the riparian buffer zone, as well as the absorption efficiency of the buffer zone, significantly affects the quality of surface water. To simulate the total nitrogen (TN) and total phosphorus (TP) loads in the effective area of the riparian buffer zone within the upper and midstream areas of the Ziwu River, the aforementioned Soil and Water Assessment Tool (SWAT) was employed. This section aims to estimate the concentration of pollutants in surface runoff upon reaching the boundary of the riparian buffer zone, by utilizing an empirical formula (Brezonik and Stadelmann 2002). The calculation formula is shown below as Formula (6).

$$C=\frac{W}{0.01\alpha \psi PA}$$
(6)

where C is average concentration of pollutants (mg/L); W is the pollution load of the drainage area of a certain area in a certain period (kg); P is the rainfall in a certain period (mm); A is the drainage area for sites (ha); α is the runoff correction coefficient, for which the general value is 0.9; and ψ is the comprehensive runoff coefficient of the drainage area.

The comprehensive runoff coefficient of the drainage area ψ is based on relevant provisions in the Code for the Design of Building Water Supply and Drainage (GB50015-2019). The runoff coefficients of various underlying surfaces were selected according to Table 2 (China Association for Engineering Construction Standardization 2019).

Table 2 Value of runoff coefficient

Analysis of the safe width of the riparian buffer zone and its influencing factors

This section utilizes “Conservation Buffers: Design Guidelines for Buffers, Corridors, and Greenways” published by the US Department of Agriculture (Bentrup 2008) to calculate the appropriate width of the riparian buffer zone in the upper and middle reaches of the Ziwu River. As illustrated in Fig. 3, there are seven curves that correlate the purification efficiency of the riparian buffer zone with its width. Each curve on the graph compares the purification efficiency of a riparian buffer zone of varying widths, created from different C factors, slope, soil texture, runoff area length, and pollutant types. Refer to Bentrup (2008) for more information. Factor C is calculated using the USLE equation (Han et al. 2021). The length of the runoff area, C factor, and slope in the basin are determined based on the average conditions of the corresponding subarea in the riparian buffer zone. Based on Fig. 2b, the riparian buffer zone consists primarily of yellow‒brown soil, brown soil, yellow–cinnamon soil, and paddy soil, with a soil texture of silty clay loam (Nie et al. 2020). Due to the impact of the geographical location on the safe width of the riparian buffer zone, the curve for calculating the appropriate width is adjusted based on expert opinions. Refer to Table 3 for details.

Fig. 3
figure 3

Comparison between the width of the riparian buffer zone and the interception efficiency

Table 3 Adjustment rules for the curve for calculating the safe width of the riparian buffer zone

The results of the Kolmogorov‒Smirnov and Shapiro‒Wilk tests showed that the p values for each factor were greater than 0.05 (Table 4), which satisfied the prerequisite conditions for Pearson correlation analysis and the Mantel test. Accordingly, R programming language was utilized to conduct a correlation analysis on several factors related to the riparian buffer zone in the upper and middle reaches of the Ziwu River, including slope, average width, buffer zone area, river length, regional area, cultivated land area, biodiversity index, population density, shape index, patch binding degree, and multiyear average values of total nitrogen and total phosphorus (Xia and Yan 2009). The aim of the analysis was to identify the primary factors influencing the width of the riparian buffer zone. Moreover, the landscape pattern software, Fragstats 4.2, was used to calculate the connectivity, shape index, and patch binding degree of the riparian buffer zone.

Table 4 The results of the Kolmogorov‒Smirnov and Shapiro‒Wilk tests

Results and discussion

Analysis of the spatial distribution pattern of the riparian zone

In this study, we employed the random forest model to classify the upper and middle regions of the Ziwu River. The resulting classification data were then imported into ArcGIS 10.4 and converted from a grid to shapefile format. Previous scientific research has evidenced that the width threshold of the riparian buffer zone spans from 30 to 200 m (Jiang et al. 2019; Aguiar et al. 2015). Considering the crucial role of riparian buffer zones in providing wildlife habitat, it is necessary to select a research scope that surpasses the width of the habitat (approximately 1000 m) (Stahl et al. 2020). We therefore selected a study area of 1200 m along both banks of the Ziwu River. The extracted classification data were clipped using the shapefile buffer zone, and we obtained the spatial pattern of the riparian buffer zone distribution in the upper and middle reaches of the Ziwu River, as presented in Fig. 4. Overall, our results indicate that the riparian buffer zone in these regions is adequate, although some areas suffer from significant fragmentation. This fragmentation is particularly visible in the right panel of Fig. 4, which displays how the agricultural lands in this section are often located in close proximity to the river, leading to a less than optimal width or a missing riparian buffer zone.

Fig. 4
figure 4

The left image shows the spatial pattern of the riparian buffer zone in the upper and middle reaches of the Ziwu River, while the right image shows a partially enlarged view of the riparian buffer zone

Calibration and verification of the SWAT model

As presented in Table 5, a total of 27 parameters were identified as having a significant impact on the simulation of nonpoint source pollution in the upper and middle reaches of the Ziwu River. These parameters were determined based on relevant literature sources (Tejaswini and Sathian 2018; Sao et al. 2020; Malik et al. 2022), with the variables v and r representing assignment replacement and percentage floating values, respectively. To ensure the accuracy of our findings, we calibrated and verified the runoff process before proceeding to calibrate nutrient levels according to previous studies (Zhang et al. 2022; Li et al. 2022).

Table 5 Parameters available for sensitivity analysis

The model’s fitting performance during the runoff calibration and verification periods is depicted in Fig. 5. The RE, R2, and Ens coefficients for the calibration and validation periods were − 14.43%, 0.85, and 0.65 and − 14.12%, 0.95, 0.72, respectively. Based on the evaluation methods described above for runoff simulation effects. The simulation experiment of runoff in the upper and middle reaches of Ziwu River yielded good results for both the relative error (RE) in the calibration and verification periods and “good” and acceptable results for the Ens coefficient in the verification and calibration periods, respectively. The R2 values for runoff in the calibration and verification periods were greater than 0.85, indicating a significant correlation. In conclusion, the results showed that the SWAT model is highly reliable for simulating runoff in the upper and middle watersheds of the Ziwu River.

Fig. 5
figure 5

Best fit curve of runoff calibration and verification

To provide a more discernible comparison between the measured and simulated runoff values, we compared their respective discharge hydrographs. As depicted in Fig. 6, the simulated values closely approximate the measured values, and the hydrographs coincide in several instances. These findings suggest that the simulation results better represent the actual changes in runoff throughout the upper and middle watersheds of the Ziwu River.

Fig. 6
figure 6

Hydrograph of measured and simulated monthly runoff

Figure 7 shows the fitting effect of the model in the TN calibration period and verification period. The RE, R2, and Ens coefficients of the calibration and validation periods were 1.89%, 0.68, and 0.65 and − 11.92%, 0.83, and 0.83, respectively. According to the above evaluation methods of the water quality simulation effect, in the TN simulation experiment, the evaluation results of the relative error (RE) of the TN calibration period and verification period were “very good” and “good,” respectively, the evaluation grade of the Ens coefficient of the calibration period was “acceptable,” and the evaluation grade of the Ens coefficient in the verification period was “very good.” The certainty coefficients (R2) of the TN calibration period and verification period were greater than 0.65, and the linear relationship was “acceptable.” Briefly, the SWAT model had generally acceptable experimental results for the TN simulation in the riparian buffer zone of the upper and middle reaches of the Ziwu River.

Fig. 7
figure 7

Best fit curve of TN calibration and verification

Figure 8 shows the fitting effect of the model in the TP calibration period and verification period. The RE, R2, and Ens coefficients of the calibration and validation periods were − 4.88%, 0.81, and 0.75 and 42.41%, 0.85, and 0.81, respectively. A comparison of the calculated results of indicators with the above evaluation standards revealed that the evaluation results of the relative errors (RE) of TP in the calibration period and the verification period were “very good” and “acceptable,” respectively; the evaluation results of the Ens coefficient in the calibration period and the verification period were “very good” and “good,” respectively; and the correlation coefficients (R2) of both were greater than 0.8, showing a significant correlation. The SWAT model can be used to simulate the TP load in the riparian buffer zone of the upper and middle reaches of the Ziwu River.

Fig. 8
figure 8

Best fit curve of TP calibration and verification

Temporal and spatial distribution of the pollution load in the riparian buffer zone

The water quality of rivers is closely related to the flow. Under the same pollution load, the water quality of rivers varies greatly with different flows. Therefore, in this study, the TN and TP loads in the riparian buffer zone (1200 m on both sides of the river) of the upper and middle reaches of the Ziwu River in the dry season (November–March of the next year), normal season (April–June) and wet season (July–October) were simulated and calculated, respectively, so as to make the calculation and analysis of the pollution load in the riparian buffer zone more scientific. Figure 9 shows the spatial distribution of TN and TP loads in the riparian buffer zone of the upper and middle reaches of the Ziwu River in the dry season, normal season, and wet season.

Fig. 9
figure 9

Spatial distribution of the pollution load in the riparian buffer zone

The TN load average exhibited an order of upstream (0.79 kg/ha) < midstream (2.19 kg/ha) < downstream (3.78 kg/ha). Similarly, the TP load average followed the sequence of upstream (0.044 kg/ha) < midstream (0.526 kg/ha) < downstream (0.993 kg/ha). This can be attributed to the gradual increase in the proportion of farmland from upstream to downstream. Temporally, the TN average displayed the order of normal season (4.22 kg/ha) > wet season (2.37 kg/ha) > dry season (0.17 kg/ha). Similarly, the TP average demonstrated the sequence of dry season (2.833 kg/ha) > normal season (1.754 kg/ha) > wet season (0.101 kg/ha). The reason is that the surface runoff generated by rainfall is the main driving force for agricultural non-point source pollutants to enter the surface waters (Bai et al. 2020). When the rainfall increases, the TN and TP loads flowing from farmland to surface water body through surface runoff increase. However, the pollution load in the riparian buffer zone is also closely related to the land use mode, agricultural management mode, and soil type. The residents on both sides of the two tributaries on the left side of the middle reaches of the basin are densely distributed, most of the domestic sewage is discharged directly, and the proportion of farmland is relatively high (Fig. 2), so the TN and TP loads are relatively high. The reason why the TN load of the riparian buffer zone in the wet season is lower than that in the normal season may be that the crops in the region are mainly rice in summer, and the last nitrogen fertilizer in the growth cycle is applied in mid-June. Generally, nitrogen fertilizer is not applied during the wet season.

Temporal and spatial distribution of the pollutant concentration in surface runoff

Figure 10 shows the distribution of TN concentration when the surface runoff in the upper and middle reaches of the Ziwu River reaches the edge of the riparian buffer zone in the dry season, normal season, and wet season. The figure shows that when the surface runoff reaches the edge of the riparian buffer zone, the TN concentration gradually increases from upstream to downstream in the basin. The concentration is the lowest in the dry season, increases gradually in the normal season, and then decreases in the wet season. Table 6 shows the average TN concentration when surface runoff reaches the edge of the riparian buffer zone in each section of the basin in the dry season, normal season, and wet season. The table shows that the average TN concentration in the surface runoff of the whole basin is the highest in the normal season, and the lowest in the dry season. To ensure the absolute safety of the water source area, the maximum concentration in the whole year is selected as the final concentration of this section for the subsequent calculation of the safe width of the riparian buffer zone, so the final calculated TN concentrations in the surface runoff of the upper, middle, and lower reaches of the basin are 0.45, 0.58, and 0.62 mg/L, respectively.

Fig. 10
figure 10

Distribution of the TN concentration in surface runoff when it reaches the edge of the riparian buffer zone

Table 6 Average concentration of TN in surface runoff in dry season, normal season and wet season

Figure 11 shows the distribution of the TP concentration when the surface runoff in the upper and middle reaches of the Ziwu River reaches the edge of the riparian buffer zone in the dry season, normal season, and wet season. The figure shows that the spatial distribution of the TP concentration is similar to those of the TN concentration. Table 7 shows the average TP concentration when surface runoff reaches the edge of the riparian buffer zone in each section of the basin in the dry season, normal season, and wet season. The table shows that the average TP concentration in surface runoff is the highest in the normal season, and the concentration decreases slightly in the wet season. Accordingly, the final calculated TP concentrations in the surface runoff of the upper, middle, and lower reaches of the basin are 0.021, 0.027, and 0.035 mg/L, respectively.

Fig. 11
figure 11

Distribution of the TP concentration in surface runoff the edge of the buffer zone

Table 7 Average TP concentration in surface runoff in the dry season, normal season and wet season

Results of the analysis on the safe width and factors influencing riparian buffer zones

Analysis of the factors influencing the safe width of the riparian buffer zone

The Kolmogorov‒Smirnov and Shapiro‒Wilk tests were conducted with p values greater than 0.05; therefore, Pearson correlation analysis and the Mantel test were used here to test the correlations among different parameters. According to the correlation analysis (Fig. 12), the positive factors that have a significant impact on the safe width of the riparian buffer zones are slope, landscape shape index, cultivated land area, population density, and riverbank buffer zone area. On the other hand, negative factors, such as river length, patch cohesion, and connectivity, have an even greater impact on the safe width of the riparian buffer zones. The safe width of the upstream riparian buffer zone is influenced by two main factors: the slope of the riparian buffer zone and the degree of patch cohesion. In the middle reaches, several factors have a greater impact on the safe width, including the river length, landscape shape index, patch cohesion, and cultivated land area. Additionally, the slope, population density, and total nitrogen load contribute significantly to the required safe width. In downstream areas, the main factors affecting the safe width are patch cohesion, slope, and population density, with connectivity as a secondary consideration. This is because the patch cohesion, shape index, and slope of the riparian buffer zone affect its ability to purify pollutants in runoff. A lower patch cohesion or higher shape index results in a higher degree of fragmentation in the spatial pattern of the buffer zone, leading to a decreased pollutant removal effect and requiring a wider safe width (King et al. 2016). The slope controls the removal efficiency of pollutants by altering the flow rate of runoff. A steeper slope reduces the residence time of runoff on the slope, resulting in a poorer pollutant removal effect and necessitating a wider buffer zone (Peak and Gil 2015). Similarly, a higher population density and cultivated land area lead to a greater pollution load and human interference. Therefore, an increase in the cultivated land area or population density requires a wider safe width for the riparian buffer zone.

Fig. 12
figure 12

Correlation analysis results. Note: The size, color, and thickness of the stars and lines in the figure indicate whether there is a significant correlation between the length of the river (RL), connectivity (C), landscape pattern index (LSI), patch cohesion (COHE), population density (RD), riverbank buffer zone area (RBZA), cultivated land area (CLA), biodiversity index (BI), and average width of the riparian zone

Calculation of the safe width of the riparian buffer zone

According to the standard concentrations of TN and TP in class I and II water quality specified in the Environmental Quality Standards for Surface Water (Ministry of Ecology and Environment of the People’s Republic of China 2002), the necessary removal rates for TN and TP in the riparian buffer zone of each section of the basin can be calculated. The necessary safe width of the riparian buffer zone can be calculated by referring to Fig. 3. The calculated results are shown in Table 8. The table shows the removal rate of pollutants in the surface runoff in the upper reaches of the basin should be 55.56%. This area is the source of the river. According to the class I water quality standard for surface water, the width of the riparian buffer zone in this area is at least 77.9 m. The pollutant removal rate of surface runoff in the middle reaches of the basin should be 13.79%. According to the class II water quality standard for surface water, the width of the riparian buffer zone in this area should be at least 33.37 m. The removal rate of pollutants in the downstream surface runoff of the basin shall be 28.57%, and the width of the riparian buffer zone in this area should be at least 60.25 m. Table 8 shows that the TN concentration is the decisive factor for the required width of the riparian buffer zone in the upper and middle reaches of the studied basin, and the TP concentration is the main factor affecting the width of the riparian buffer zone in the lower reaches of the basin.

Table 8 The removal rate of nonpoint source pollution and the safe width of the riparian buffer zone in each subarea

Conclusions

This study identified the riparian buffer zone in the upper and middle reaches of the Ziwu River, and simulated and calculated the nonpoint source pollution load in the riparian buffer zone. At the same time, this study also estimated the concentration of nonpoint source pollutants when surface runoff reached the edge of the riparian buffer zone, found the factors that had a greater impact on the safe width of the riparian buffer zone in the upper and middle reaches of the Ziwu River, and calculated the safe width of the riparian buffer zone in each subarea. The findings demonstrated that the SWAT model is highly accurate in simulating loads of nonpoint source pollution within the riparian buffer zone of the upper and middle reaches of the Ziwu River. The spatial distribution of the TN load in the riparian buffer zone gradually increased from upstream to downstream. Temporally, the TN load was the largest in the normal season and the smallest in the dry season. The TP load also increased gradually from upstream to downstream; temporally, the load of TP load was the largest in the wet season and the smallest in the dry season. When the surface runoff reached the edge of the riparian buffer zone, the TN and TP concentrations increased gradually from upstream to downstream in the basin. The concentration was the lowest in the dry season, increased gradually in the normal season, and then decreased in the wet season. The slope, landscape shape index, patch cohesion and connectivity of the riparian buffer zone, cultivated land area, and regional population density had a great influence on the safe width of the riparian buffer zone in the upper and middle reaches of the Ziwu River. This study suggests that the safe width of the riparian buffer zone in the upper, middle, and lower reaches of the basin should be 77.9 m, 33.37 m, and 60.25 m, respectively. This study can provide a practical case for the planning and design of riparian buffer zones and ecological environment restoration at the basin scale to achieve more widespread coordination between river water ecosystems and human development.