Introduction

China is rich in Pb and Zn mineral resources, especially in southern provinces such as Guangxi, Hunan, and Guizhou. The mining of Pb–Zn mines has increased local government revenue, but at the same time, it also increased ecological and environmental problems (Yang et al., 2018; Zhang et al., 2013). In the early days, the frequent mining activities without relevant environmental protection measures have resulted in the release of massive amounts of heavy metals (Cd, Pb, Zn, etc.) into the environment. The accumulation of heavy metals increases environmental and ecological risks and ultimately endangers human health through the food chain and other pathways. Heavy metal contamination in agricultural soils in mining areas has become an environmental problem that needs attention (Shi et al., 2021; Zhang et al., 2012), and its pollution status needs to be urgently investigated and evaluated the ecological risk.

The heavy metal contamination in the soil of mining areas was caused by many factors. Accurately identifying and quantifying the sources of heavy metals in soil is essential to cut off the sources and prevent soil contamination. In general, there are two main sources, one is the natural source which refers to the soil parent material, and the other one is anthropogenic source related to mining-related activities, transport activities, agricultural activities, atmospheric deposition, and other industrial activities. Correlation analysis (CA), principal component analysis (PCA) (Huang et al., 2012; Liu et al., 2017), geographic information system (GIS) (Hou et al., 2017), and other methods (Yang et al., 2017) have been widely applied in the analysis of soil contamination sources. However, these methods could only identify the type of pollution source but not quantify it. Positive matrix decomposition (PMF) is an effective receptor model to obtain the source classification and give the specific contribution of the source. It has been widely used in soil or sediment contamination source analysis and has achieved good results (Liang et al., 2017; Ran et al., 2021). Using a single method often has limitations, and different study areas have different characteristics, so the combination of multiple techniques and take consideration of the local environment and pollution conditions is a more effective pollution tracing strategy (Dong et al., 2019; Lang et al., 2015).

The study area is located in Gongcheng Yao Autonomous County, which is rich in mineral resources, the main mineral resources are tungsten, tin, zinc, tantalum, niobium, granite, etc., and the predominant mineral resource in the study area is Pb–Zn ore. The exploitation of minerals brought great economic benefits but also had a serious environmental impact on the surrounding environment. However, the contamination in the area has not been carefully and comprehensively investigated, and further investigation of soil contamination in the area is urgently needed, and the specific sources of pollution and their contribution need to be clarified.

The objectives of this study are as follows: (1) to determine the concentration of eight heavy metals in the soil and map the spatial distribution; (2) to assess the accumulation and ecological risk of heavy metals in soil; (3) to identify and quantify the pollution sources of eight heavy metals in soils. This study will support our understanding of the contamination characteristics and sources of farmland soils in mining areas, and provide basic information for the next step of pollution risk control and remediation.

Materials and methods

Study area

The study area is located in Gongcheng Yao Autonomous County of Guilin, Guangxi, China (Fig. 1). The study area has a strongly cut topography, with an altitude between 232 and 1579 m (Fig. 9). A river runs through the entire study area, and farmlands are distributed on both sides of the river. The climate is a subtropical monsoon climate, with the dominant wind direction from the northeast, long summer and short winter, the average annual temperature is 19.6 °C. The study area is rich in rainfall, with an average annual precipitation of 1542.1 mm. The main crops are citrus, corns, and vegetables.

Fig. 1
figure 1

Map of the study area and soil sampling sites

There are two abandoned Pb–Zn mines in the study area that were produced from the 1950s to the 1990s. As reported (Wang, 2019), there were many pits in the mine, and the mineral company discharged the pit wastewater directly into the streams and ditches without any treatment, and the random piles of slag would be washed further away with the rain. Long-term mining activities have caused serious pollution to the surrounding soil and water environment, resulting in a significant drop in crop production and threatening the health of the local resident. In addition, although the Pb–Zn mines have been abandoned for many years, the heavy metals in the waste rock and tailings may be released into the soil and rivers through weathering, oxidation, leaching, and scouring, and causing continuous pollution to the surrounding environment. So, it is urgent to investigate the pollution situation in this area and take pollution control and remediation measures as soon as possible.

Soil sampling and determination

Since the farmlands in the study area are discontinuously distributed on both sides of the river, we merged the adjacent farmlands into one plot, and divided the entire study area into 25 plots shown in the Fig. 1. During 2019, 132 soil surface samples (0–20 cm) were collected by establishing a 40 × 40 m grid on each agricultural field, the specific information of each plot is shown in Table S1. The first thing to do after collecting the soil is to air dry these samples at room temperature and then sieve them. The soil samples were passed through different mesh sieves for different items, 20 mesh nylon sieve for pH determination, and 100 mesh nylon sieve for heavy metal content determination. Nine items were measured in total, and all items were analyzed using national standard test methods: pH estimated by the glass electrode method (NY/T 1121.2–2006); the samples for the analysis of Cd, Pb, Zn, Ni and Cr were digested using HCl–HNO3–HF–HClO4, As and Hg were digested using HCl–HNO3. The digestion solutions were filtered through a 0.45-µm membrane before determination. Cd and Pb were determined by graphite furnace atomic absorption spectrophotometry (GB/T 17141-1997); Zn (GB/T 17138-1997), Cr (HJ 491–2009), and Ni (GB/T 17139-1997) were determined by flame atomic absorption spectrophotometry; As (GB/T 22105.2-2008) and Hg (GB/T 22105.1-2008) were determined by atomic fluorescence spectrophotometry. Soil standard reference materials (GBW07980, GSS-38) and reagent blanks were tested simultaneously to ensure quality assurance and quality control (QA/QC). 5% of the samples were randomly selected for parallel measurement, while the outliers greater than 5 times the median value or less than 1/5 of the median value were retested. The relative standard deviation (RSD) for the duplicated samples was all < 10%.

Geo-accumulation index

Geo-accumulation index (\(I_{{{\text{geo}}}}\)) was used to determine whether farmland soils in the study area had been affected by the mining or other human activities. It is an important parameter for evaluating the heavy metal pollution in soil or sediment which has been widely used (Liu et al., 2018). The calculation formula is as follows:

$$I_{{{\text{geo}}}} {\text{ = log}}_{{2}} \left( {C_{n}^{i} /{1}{\text{.5}}B_{n}^{i} } \right)$$
(1)

where \({C}_{n}^{i}\) is the measurement value of heavy metals in farmland soil;\({\text{B}}_{\text{n}}^{\text{i}}\) is the geochemical background value of heavy metals in Guilin (Shahab et al., 2020). Content 1.5 is a coefficient that considers the influence of rock geology and other aspects on the background value (Yan et al., 2020). The \(I_{{{\text{geo}}}}\) can be divided into 7 different grades, which represent the different degrees of soil pollution (Table S2).

Potential ecological risk assessment

The widely used potential ecological risk index (\({\text{RI}}\)) (Hakanson, 1980) was used to assess the ecological risk of farmland in contaminated mining areas. The specific calculation formulas are as follows:

$$C_{f}^{i} { = }\frac{{C_{n}^{i} }}{{B_{n}^{i} }}$$
(2)
$$E_{r}^{i} = T_{r}^{i} \times C_{f}^{i}$$
(3)
$${\text{RI = }}\sum E_{r}^{i}$$
(4)

where \(C_{f}^{i}\) represents the pollution factor of element \({\text{i}}\); \(C_{n}^{i}\) is the measurement value of element \({\text{i}}\); \(B_{n}^{i}\) is background value of element \({\text{i}}\); \(E_{r}^{i}\) is the ecological risk index of element \({\text{i}}\) (Table S3); \(T_{r}^{i}\) represents the toxicity response coefficient of element \({\text{i}}.\) According to the recommendation, the toxicity factors of each element are: Cd 30, Hg 40, As 10, Pb 5, Cr 2, Cu 5, Zn 1, Ni 5, respectively (Hakanson, 1980; Xiao et al., 2021); \(RI\) is the potential ecological risk index, which is the sum of \(E_{r}^{i}\). The \({\text{RI}}\) of heavy metal in farmland soil was divided into different grades, and the percentage of each grade is shown in Table S4.

Positive matrix factorization (PMF)

The PMF5.0 model was developed by the U.S. EPA. The model performs well in identifying sources and assigning their contributions, because the model does not require measurement of detailed source composition profiles, but rather assigns source contributions by combining concentrations and uncertainties. The calculations mainly involve the following two equations:

$$x_{ij} { = }\mathop \sum \limits_{{k{ = 1}}}^{p} g_{ik} f_{kj} { + }e_{ij}$$
(5)
$$Q{ = }\mathop \sum \limits_{{i{ = 1}}}^{n} \mathop \sum \limits_{{j{ = 1}}}^{m} \left[ {\frac{{x_{ij} { - }\mathop \sum \nolimits_{{k{ = 1}}}^{p} g_{ik} f_{kj} }}{{u_{ij} }}} \right]^{{2}}$$
(6)

where \(x_{ij}\) is the measured concentration value of each sample, \(g_{ik}\) is the concentration of each source's contribution to the sample, \(f_{kj}\) is the concentration of heavy metals in each source, \(e_{ij}\) is the residual of the sample, and \(u_{ij}\) is the uncertainty of sample. More details can be seen in the EPA PMF 5.0 user guidebook.

The PMF5.0 model requires two input files, the concentration file and the uncertainty file for each element. The calculation of uncertainty (\({\text{Unc}}\)) is a key to successful analysis, and there are different methods of calculating uncertainty according to the relationship between the measured concentration and the detection limit. If the concentration is less than or equal to the method detection limit (\({\text{MDL}}\)), the uncertainty is calculated as follows:

$${\text{Unc}} = \frac{5}{6} \times {\text{MDL}}$$
(7)

However, if the measured concentration is above the detection limit, then the formula will be:

$${\text{Unc}} = \sqrt {\left( {{\text{Error Fraction}} \times {\text{concentration}}} \right)}^{2} + \left( {0.5 \times {\text{MDL}}} \right)^{2}$$
(8)

Statistical and geostatistical analyses

Statistical analyses were performed by using SPSS 25 and Excel 2019. Correlation analysis is used to analyze whether there are similar sources between different heavy metal elements. Principal component analysis was used to identify the source of pollution by dimensionality reduction and then extracting the main components. Contamination distribution was mapped with ArcMap 10.5 (ordinary kriging interpolation) and the topography map drawn by ArcSence 10.5. Some of the remaining graphs were plotted using Origin 2021. Source apportionment was performed using EPA PMF 5.0.

Results and discussion

Concentrations and spatial distributions of eight heavy metals

The descriptive statistics of heavy metals in the surface soil of agricultural fields are shown in Table 1. The mean concentrations of Cd, Hg, As, Pb, Cr, Cu, Zn, and Ni were 3.36, 0.66, 17.05, 327.21, 55.67, 42.26, 678.01, and 23.64 mg/kg, respectively. The average soil pH was 5.13 with a range of 4.48–6.27, suggesting that the soils were acidic overall in this area. According to risk control standard for soil contamination of agricultural land (GB15618-2018, Table S5), 113 of 132 topsoil samples exceeded the risk screening value. Cd, Pb, and Zn were the most polluted groups, followed by Cu and Hg, with exceeded rates of 84.09%, 72.73%, 71.21%, 21.97%, and 9.85%, respectively. The mean concentrations of Cd, Pb, and Zn were 11.20 times, 4.67 times, and 3.39 times of the standard limits (GB 15618-2018), which were 11.20, 13.63, and 8.97 times of the soils background values in Guilin (Shahab et al., 2020). On the contrary, all samples did not exceed the standard limits for As, Cr, and Ni. The coefficients of variation (CV) for Cd, Pb, Zn, Hg, and Cu were all above 50%, showing strong spatial variability, indicating that they were highly influenced by outside disturbances such as mining activities. In contrast, the CV of Cd, As, and Ni were smaller, which indicates that they were less affected by external influences and mainly by natural background.

Table 1 The descriptive statistics of eight heavy metals concentrations in farmland soils in mining area

The spatial distribution of eight heavy metals was mapped by ArcMap 10.5 (Fig. 2). Several hotspots with high heavy metals concentrations were found in the study area. For the most polluted group of elements, Cd, Zn, and Pb share some hotspot areas, such as in farmland 10, 11, 18, 20, and 21, suggesting that they may have similar sources. However, these hotspots did not have a strong relationship with the location of the mine, and this might be the result of the migration of heavy metals under water scouring, atmospheric transport, etc. The spatial distribution of Hg and Cu were similar, also have high concentrations in farmland 10, 11, 18, in addition, upstream farmland 25 is also a hotspot for them. The spatial distribution of As is scattered, with high values occurring in the upstream, midstream, and downstream areas of the whole area, but all of them do not exceed the screening value, suggesting both human activities and natural sources contribute to the distribution of As (Li et al., 2017). In general, Ni and Cr are mainly influenced by the soil-forming parent material, but the spatial distribution of Cr and Ni is not consistent (Fig. 2) due to the differences in regional geological background.

Fig. 2
figure 2

Spatial distribution of 8 heavy metals in farmland in the study area

Assessment of heavy metal pollution in farmland soils

Geo-accumulation index

The \({I}_{\mathrm{geo}}\) values of heavy metals were calculated and the classes were classified, as shown in Fig. 3. High levels of accumulation of Pb, Cd and Zn were observed in the soils, with mean \({\text{I}}_{\text{geo}}\) values of 2.41, 1.85, and 1.83, respectively (Fig. 3). It is worth noting that most of their (Pb-74.24%, Cd-70.45%, Zn-69.70%)\(I_{{{\text{geo}}}}\) values were in the range of class 2 to class 6, which indicates the most of the farmland soils in the study area have been polluted to different degrees. As shown in Fig. 3, Hg shows a moderate level of accumulation, 50% of soil samples in the range of moderately polluted level to heavily polluted level (Table S6). The vast majority (90.01%) of the soil samples for Cu with \(I_{{{\text{geo}}}}\) values located in class 0 and class 1 and 9.09% samples were in class 2 which revealed a low level of contamination. The \(I_{{{\text{geo}}}}\) value levels of As, Ni, and Cr were all in class 0 or class 1.

Fig. 3
figure 3

Box-plots of the geo-accumulation index (\({\text{I}}_{{{\text{geo}}}}\)) values for 8 heavy metals

Potential ecological risk assessment.

The potential risk index is more integrated to reflect the risk of heavy metals to the environment, since it takes environmental impacts and toxicology into account, and \(I_{{{\text{geo}}}}\) only reflects the accumulation of pollutants in the soil, so the results produced by the two methods may be not fully consistent. The results of the \({\text{E}}_{\text{r}}\) and \({\text{RI}}\) values of each element are shown in Fig. 4 and Table S7. The mean \({\text{E}}_{\text{r}}\) values of the eight elements were ordered as Cd > Hg > Pb > Zn > As > Cu > Ni > Cr, which is different from that of \({\text{I}}_{\text{geo}}\). Cd was the highest risk factor in the study area, with \({E}_{r}\) values between 5.00 and 1940.00 and a mean value of 336.32 (> 320), categorized as very high risk. Hg is the second ecological risk contribution factor due to the lower background value and the highest \({\text{T}}_{\text{r}}\) value. 93.94% of the sample sites are in the range of moderate risk to very high risk, while the proportion of considerable risk (37.88%) was the largest. The percentage of \({E}_{r}\) value for Pb decreases from low risk to very high, and the proportions of each risk level are: low risk 44.7%, moderate risk 28.79%, considerable risk 17.42%, high risk 7.58%, and very high risk 1.52%. Interestingly, 98.48% of the Zn sample sites are at low risk, which is very different from the results generated by the \({\text{I}}_{\text{geo}}\). The rest of the elements As, Cu, Cr, and Ni were all at low risk level. As shown in Fig. 4, the mean value of \(\mathrm{RI}\) was 611.56 (> 600), which indicates the study area shows very high ecological risk overall, and the proportions of four risk levels were 9.85%, 22.73%, 35.61%, and 30.30%, respectively (Table S7). The spatial distribution of the \({\text{R}}{\text{I}}\) value was mapped by kriging interpolation (Fig. S1). The \({\text{RI}}\) values are large in the midstream and upstream, and smaller in the downstream away from the mining area. This indicates that the study area was highly influenced by mining activities, which generate large amounts of heavy metals into the soil and pose a great risk to the ecological environment.

Fig. 4
figure 4

Histogram of the potential ecological risk index (\({\text{RI}}\)) for heavy metals in the farmland soil of the mining area

Identifying the sources of heavy metals in farmland soils

Multivariate statistical analyses

Correlation coefficients between the eight heavy metals in the soil were calculated and were used to deduce the possible sources, and the Pearson correlation results are shown in Fig. 5. Significant correlations (p < 0.05 or p < 0.01) were found between all heavy metal elements except Cr–Hg, Cr–As, Cr–Pb, and Ni–Zn. The highest correlation was observed in Cd-Zn with a coefficient of 0.83, followed by Hg–Cu (0.64), Hg–Cd (0.56), Cd–Cu (0.56), Cu–As (0.53), Cu–Pb (053), Cu–Zn (0.52), and Cd–Pb (0.51), the relatively large correlation coefficients suggesting that they could have the same sources. Mining activities are the primary source of heavy metals in the soil of mining areas. The ore mainly contains Pb and Zn elements, but also contains some associated elements such as Cd, Hg, and Cu. Therefore, the pollution caused by mining activities is usually a composite pollution of multiple heavy metals, and these metal elements often have a large correlation with each other (Huang et al., 2012). The weak correlations between Cr, Ni, and As with other heavy metals suggest that they may have other sources (Dong et al., 2019).

Fig. 5
figure 5

Relationships between different elements in farmland soils in mining area using scatter matrix analysis (The upper triangle is the correlation matrix (Pearson correlation coefficient; *, p < 0.05; **, p < 0.01), the diagonal is the histogram, and the lower triangle is the scatter matrix)

PCA is usually in combination with CA. PCA could extract several key factors to explain the original variable information by dimensionality reduction. A total of three principal components with eigenvalues greater than 1 were extracted (Table S8). The first component (PC1) shows the positive loading of all heavy metals accounting for 33.39% of the total variance, and the main elements are Cu, Cd, Zn, and Hg (Table S8). This result is consistent with the correlation analysis that Cd, Zn, Pb, Hg, and Cu should be from the same source, and PC1 could be classified as an anthropogenic source related to mining (Linnik et al., 2021; Stefanowicz et al., 2014). The second principal component (PC2) accounting for 14.18% of the total variance is dominated by Cr and Ni, these two elements are usually attributed to natural sources controlled by the parent matter of soils, and the mean concentrations of these two elements are below the soil background values, while the results of the \({I}_{\mathrm{geo}}\) and the \(\mathrm{RI}\) also prove that these two elements were little affected by anthropogenic activities. The third principal component (PC3) accounting for 13.64%, As, Ni, Cu, and Hg has positive loadings, and Zn, Cd, and Cr have negative loadings. The long-term agricultural production activities in the study area were carried out. Some studies (Chen et al., 2020; Zhou et al., 2021) have revealed that the extensive use of organic/inorganic fertilizers, and pesticides, caused the accumulation of heavy metals such as arsenic, Ni, and Cu in the soil, and thus PC3 should be the agricultural source.

The 3D biplot is shown in Fig. 6, which visually illustrates the different characteristics of the eight heavy metals and soil points on three principal components. The elements Pb, Zn, and points 56, 57, 54, and 59 have high scores on PC1; the elements Cr, Ni, and points 93, 66 have high scores on PC2; the elements As and points 128, 52 have high scores on PC3. These results predict the possible sources of soil heavy metals. In fact, the reasons for soil heavy metal pollution are very complex that influenced by many factors and the situation varies from one study area to another, and further analysis of the sources of heavy metals by PMF will be presented in the next section.

Fig. 6
figure 6

3D biplot of points and eight heavy metals (red dots represent soil points, blue arrows represent heavy metal element loadings, and pink ellipses represent 95% confidence ellipses)

Source apportionment by PMF

The EPA PMF5.0 model was used to quantitatively assign the sources of eight heavy metals in farmland soils in mining areas. Initially, 3, 4, and 5 factors were set according to the results of PCA, and the number of factors with a better linear fit and the smallest Q-value was selected based on the model. To make the results more interpretable, samples with residuals greater than the absolute value of 4 were excluded (Cheng et al., 2020). The model calculation results show that the Q-values are the lowest and most robust when the number of factors is 4. The R2 values of the fitting results (predicted/observed concentrations) for Pb, Hg, Cd, Zn, Cu, As, Cr and Ni are 0.996, 0.986, 0.978, 0.977, 0.917, 0.729, 0.569, and 0.497, respectively, and most of the elements have good fitting results (R2 > 0.7), so the PMF results are reliable. The results of PMF are shown in Fig. 7.

Fig. 7
figure 7

Contribution rates of four factors to heavy metals based on PMF

The main loading elements of factor 1 were Cd and Zn, with contributions of 71.09% and 61.88%, respectively (Fig. 7). Numerous studies have shown that mining activities in lead and zinc mining areas can result in the release of large amounts of Cd, Zn, and Pb into the soil or water environment, causing serious pollution (Qin et al., 2019; Xu et al., 2017; Zhao et al., 2020). The mining industry generated a large amount of waste rock and tailings during the production process. Those solid wastes, which have not been properly treated, would continue to release heavy metals into the environment under weathering and leaching, even though mining activities have ceased for many years (Chen et al., 2018; Stefanowicz et al., 2014). According to the interview and investigation (Wang, 2019), the mining company did not take effective environmental protection measures in the process of mining and beneficiation and even directly discharged wastewater and tailings into the river in this region. The particles loaded with heavy metals would be carried further away with the flow of water, causing a wider range of pollution. Therefore, the distribution area from high concentrations of cadmium and zinc was not exactly in the area close to the mine but appeared in a region downstream (Fig. 2).

The research area is rich in rainfall, and when the rainy season comes, the river is strongly disturbed and the sediments containing heavy metals are easily resuspended. When floods occur, farmland close to the river may be directly flooded and some sediments remain in the soil. For example, the river next to the farmland 10 and 11 (the area where most of the heavy metals have high values, Fig. 1, Fig. 2) has an S-shape, and when the flood comes, the water may flow directly over farmland and the sediment may be trapped in the soil. During the 1998 China mega-flood disaster, low elevation farmlands in the study area were probably inundated. Furthermore, Cd and Zn exist mainly in an exchangeable state in the mining river and were primarily distributed in fine particles (Qin et al., 2021), and they tend to migrate more easily, while Pb exists in a residue state (Buyang et al., 2019; Ma et al., 2019), so Cd and Zn loadings are high and Pb loadings are low for factor 1. In conclusion, factor 1 can be deduced as a source of mining activities.

Factor 2 was dominated by Hg (73.01%), followed by Cu (31.71%), As (26.44%), Cd (19.20), and Zn (15.82%). In the study area, large quantities of citrus and corns were grown. Irrigation water, pesticides and fertilizers need to be applied in large quantities to ensure production. It has been reported that the main source of Hg in farmland in the Pb–Zn mining area was wastewater irrigation (Deng et al., 2011), and the irrigation water in this study area was mostly from the polluted River. Huang et al. (2015) found that organic fertilizers were the main source of Hg in agricultural soils by isotope ratio analysis. So, agricultural activities might be an important source of Hg in the soils of the region. The accumulation of As, Cd, Cu, and Zn in soils due to fertilizer application has been widely demonstrated (Chen et al., 2020; Zhou et al., 2015). The use of livestock manure is another important contributor to the accumulation of Cu and Zn in agricultural soils, whether from large-scale breeding or scattered breeding. Since a large number of additives containing Cu and Zn were used to promote the growth of livestock in the process of large-scale breeding (Luo et al., 2009; Zhou et al., 2021), while in the scattered breeding process livestock in mining area would eat grasses that have accumulated heavy metals (Yanqun et al., 2005). Cu-containing fungicidal pesticides were often used in citrus cultivation, so the accumulation of Cu in the soil of fruit-growing areas was mainly related to the application of pesticides (Dao et al., 2021). In contrast, the accumulation of Pb in soil was unlikely due to pesticide and fertilizer application (Bai et al., 2015) and was also less likely to enter the soil with sewage irrigation (this was discussed in the analysis of Factor 1). So, it can be inferred that factor 2 is the source of agricultural activities.

All elements have loadings on factor 3, with the primary element as Pb (85.11%). The distribution of Pb concentrations was highly consistent with the distribution of the contributions of factor 3 (Fig. 2 and 8), showing a large-scale regional pollution, associated with atmospheric sources. Lead is a marker element of traffic pollution sources because the burning of gasoline causes the release of lead; in addition, mining, ore crushing, transportation, smelting, and other processes would generate a large amount of dust containing heavy metals, which would eventually be deposited into the soil with gravity or rain; this was confirmed via the isotope ratio method by Kong et al. (2018). What's more, the study of Sondergaard et al. (2013) shows that dust can still be generated and cause widespread pollution even after the mine is closed. From the perspective of topography (Fig. 9), the study area is a valley topography, so the dust generated in the area is not easy to spread. Meanwhile, the valley opens to the northeast, the dominant wind direction is also northeast in this area, and the fine dust drifting from other places will also affect the study area. The concentrations of Pb in the downwind direction were significantly higher than those in the upwind direction due to the influence of the topography and the prevailing wind. In contrast, the upper left corner of the study area is located deep in the valley, and the prevailing wind was blocked by the mountain, so the area has a lower Pb concentration. Therefore, factor 3 was identified as the atmospheric deposition source.

Fig. 8
figure 8

The spatial distribution of the contributions of the four factors based on the PMF model

Fig. 9
figure 9

The topographic map of the study area

Factor 4 was mainly characterized by Cr (72.96%), Ni (66.04%), and As (55.98%), and the contributions of factor 4 are distributed in a narrow range of − 2.00 to 2.112. In general, Cr, Ni, and As in soils of Pb–Zn mining areas are mainly from a natural source (Huang et al. 2012; Xu et al., 2017). Even though the study area has experienced long-term mining and agricultural activities, the measured values in all samples did not exceed the national standard limits and were similar to the soil background values, also the CV of these three elements were significantly smaller than the other five elements, indicating that human activities are not the main influencing factors of these three elements. The results of the PMF are also basically consistent with the results of the PCA. Therefore, factor 4 is from a natural source.

Conclusions

In this study, we investigated the concentrations and distributions of eight heavy metals in farmland soils of a Pb–Zn mining area in Gongcheng Yao Autonomous County, assessed their accumulation levels and potential ecological risks, and analyzed the main sources. The mean concentrations of Cd, Hg, As, Pb, Cr, Cu, Zn, and Ni were 3.36, 2.84, 17.05, 327.21, 5.67, 42.26, 678.01, and 23.64 mg/kg, respectively. Cd, Pb, and Zn were the most polluted groups, followed by Cu and Hg, with exceedance rates of 84.09%, 72.73%, 71.21%, 21.97%, and 9.85%, respectively. The mean values of \(I_{{{\text{geo}}}}\) were rank as Pb (2.41) > Cd (1.85) > Zn (1.83) > Hg (1.21) > Cu (− 0.19) > Ni (− 0.79) > As (− 0.94) > Cr (− 1.18), indicating serious accumulation of Pb, Zn, Cd, and Hg. The whole study area presents a very high ecological risk, with an average \({\text{RI}}\) of 611.56, and the main ecological risk factors are Cd, Hg, Pb. Multivariate statistical analysis, PMF, and GIS were used to analyze the pollution sources of soil heavy metals. Four main sources were identified and quantified: Cd (71.09%) and Zn (61.88%) were mainly from mining activity sources such as waste rock, tailings, wastewater, and sediment; Hg (73.01%) was mainly from agricultural activities such as sewage irrigation, organic fertilizers; Pb (85.11%) was mainly from atmospheric deposition; Cr (72.96%), Ni (66.04%), As (55.98%) were mainly from natural sources. The accumulation of Cu was mainly controlled by agricultural activities (37.70%) and natural sources (31.71%).

Mining activities are the main source of heavy metals in the farmland soils in mining areas, but agricultural activities and the deposition of heavy metal-containing particles should not be ignored. The heavy metal pollution of soil is the result of multiple factors, and the identification of its pollution sources requires an integrated approach and specific analysis according to local conditions.