Introduction

Mangrove forests are distributed along coastlines in tropical and subtropical regions, providing a wealth of ecosystem services, including carbon sequestration, biodiversity maintenance, and coastal protection1,2,3,4. Due to their unique growth environment, mangroves are among the most sensitive ecosystems globally, facing synergistic pressures from coastal urbanization (e.g., land reclamation), hydrological alterations (e.g., reduced freshwater input), and climate-driven stressors including sea-level rise, intensified typhoons, and elevated atmospheric CO25. Reports indicate globally a continuous degradation trend in mangrove ecosystems over the past two decades6. Maintaining the functioning of mangrove ecosystems and promoting their healthy development became a focal point of global concern.

China’s coastline constitutes the northernmost global distribution limit for mangroves, but still supports diverse mangrove species. The degradation of mangrove forests is nevertheless a pressing concern7,8. It is attributable to multiple factors, with species invasion emerging as a particular critical driver9. Spartina alterniflora, an indigenous salt marsh plant originating from the American continent, was introduced in 1979 with the aim of promoting sediment accumulation and land reclamation10,11. Due to a subsequently comprehensive invasion, the species has been becoming a prominent constituent of China’s coastal wetlands12; and halting this invasion has become a important objective in current coastal wetland management practices8,13.

The ecological niche concept, which encompasses the environmental conditions and resources that define species distributions and interactions, is critical for predicting invasion dynamics14. When invasive and native species exhibit high niche overlap, such as sharing similar patterns of resource use or environmental requirements, competitive exclusion may occur, potentially leading to the decline of native species15. In the case of mangroves and Spartina alterniflora, previous studies have confirmed the existence of niche overlap and biotic interaction between them2,16,17,18. From a biogeographical perspective, this overlap is primarily concentrated in tropical and subtropical regions. One major contributing factor is the occurrence of extreme cold events (mean daily temperatures below −4 °C19), which limit the expansion and persistence of mangroves in temperate zones. However, due to interspecific variation in cold tolerance among mangrove species, different populations experience varying levels of threat from Spartina alterniflora. Accurately identifying and quantifying areas of potential co-occurrence is therefore essential for implementing targeted conservation strategies and reducing the invasion success of Spartina alterniflora.

Species Distribution Models (SDMs), founded on the central assumption that species distributions are constrained by their ecological niche requirements (e.g., temperature, precipitation, and resource competition), are theoretically grounded in niche theory, which provides a conceptual framework for linking species occurrences to environmental conditions1,20,21. Over the past decade, SDMs have become essential modeling tools in biogeography, macroecology, invasion biology, evolutionary biology, and biodiversity conservation. In coastal wetland, SDMs has also been applied to map the restoration potential of mangrove forests in China8,22, as well as to identify environmental covariates in the distribution of mangroves in Mexico23. Previous studies have also tried to quantify the niche of mangroves and Spartina alterniflora in China in order to identify potential measures to prevent Spartina alterniflora invasions and to promote the development of mangroves24. Unfortunately, most existing studies have primarily focused on the distribution of the mangrove community as a whole and its driving factors, while overlooking interspecific differences in distribution patterns and ecological requirements among mangrove species. In addition, compared with single algorithm-driven species distribution models, ensemble species distribution models(ESDM) integrate the strengths of multiple algorithms, reducing reliance on the assumptions of any single model and thereby producing more stable and reliable predictions25.

Thus, the study presented uses ensemble species distribution models (ESDM) to quantify the ecological distributional characteristics based on environmental factors (temperature, precipitation, soil properties, and topography) of Spartina alterniflora and nine major mangrove species naturally occurring in the Chinese mainland. A comparative analysis of similarities between the ecological niches is conducted.This study aims to address: (1) What is the degree of niche overlap between major mangrove species and Spartina alterniflora along China’s coast? (2) Which environmental factors drive niche differentiation between native mangroves and the invasive species? (3) How do latitudinal distribution ranges and climatic adaptability differ between these species? Understanding these niche overlaps can inform spatially explicit management strategies, such as prioritizing conservation species, controlling Spartina alterniflora spread, or guiding mangrove restoration efforts in vulnerable zones.

Materials and methods

Study area

China has an extensive coastline with a considerable number of coastal wetlands. We defined the study area as a 20 km buffer zone along Chinese coastline (Fig. 1). This coastal zone is home to a diverse range of plant species, including trees, shrubs, herbs.

Fig. 1
Fig. 1
Full size image

The study area considers potential coastal habitats ranging 20 km from the coastline landwards. The figure created in ArcGIS v10.4 (https://desktop.arcgis.com).

Data sources

Species distribution data

The nine main mangrove species widely distributed in the mainland of China were considered namely Acrostichum aureum, Excoecaria agallocha, Bruguiera gymnorrhiza, Kandelia obovate, Rhizophora stylosa, Lumnitzera racemose, Aegiceras corniculatum, Avicennia marina, and Acanthus ilicifolius. Species excluded from this study, such as Ceriops tagal, have extremely limited distribution ranges that do not overlap with the invaded areas, and therefore cannot provide meaningful data.

The dataset specifying the presence-absence of mangrove species and Spartina alterniflora was derived from the China Coastal Zone Wetland Plant Survey dataset (2013–2017) provided by National Earth System Science Data Center, National Science & Technology Infrastructure of China (http://www.geodata.cn), and the data provided by the GBIF website(https://www.gbif.org/, accessed 29 September 2023) using the gbif function available in dismo package. Each presence record underwent a thorough accuracy check before usage. To eliminate spatial autocorrelation and sample bias, we conducted point selection based on environmental data resolution (1 km), ensuring that only one sample point was retained in each grid cell (Fig. 1).

Data set of environmental factors driving the occurrence of plant species

For modelling the potential habitat distribution of the selected plant species across the study region, climatic data were downloaded from (http://www.worldclim.org) WorldClim database. These environmental variables had a spatial resolution of 30 arc seconds (approx. ~ 1 km resolution at the equator). The data set includes various terrestrial and marine climate data, topographic data, and soil properties. A detailed list of these data can be found in26. Variables with Pearson’s |r|> 0.8 were excluded through stepwise elimination22, retaining 17 predictors (Table 1) to mitigate multicollinearity.

Table 1 Environmental factors used in this study and their respective variable names.

Research methodology

This study has two main objectives. Firstly, to quantitatively characterize the distribution patterns of nine widely distributed mangrove species and Spartina alterniflora at the population level within China. Secondly, to individually compare the ecological niche similarities between each mangrove species and Spartina alterniflora. The specific workflow is illustrated in Fig. 2.

Fig. 2
Fig. 2
Full size image

Framework of this study.

Ecological niche characterization

In the present study, we used SSDM package within the R statistical software (v 4.3.0) to perform the species distribution modelling27. The package provides multiple statistical models of varying complexities and features offering numerous potential projections. An assemblage of the chosen models, selected based on a set of evaluative standards, has regularly proven to enhance the transferability of the model across time. Nine different algorithms were used in SSDM package, including: Generalized linear model (GLM)28, Generalized additive model (GAM)29, Multivariate adaptive regression splines (MARS)30, Generalized boosted regressions model (GBM)31, Classification tree analysis (CTA)32, Random forest (RF)33, Maximum entropy (MAXENT)34, Artificial neural network (ANN)35, and Support vector machines (SVM)36. Nine algorithms (GLM, GAM, MARS, GBM, CTA, RF, MAXENT, ANN, SVM) were integrated via weighted averaging based on their AUC performance.

For each species, the distribute points were arbitrarily split into 75% for training and remaining 25% for validating37. To strengthen the evaluation of model performance, the entire procedure (random selection of the training set and the validation set) was repeated 4 times20 obtaining a total of 360 models (10 replicate pseudo-absence datasets × 9 algorithms × 4 replicates).

The cross-validation method was used to split the occurrence dataset for model evaluation using the Area Under the Curve (AUC) those values range from 0 to 1. An AUC value between 0.5 and 0.7 indicates poor, 0.7–0.9 good and > 0.9 high model performance20.

Transforming the results of each species distribution model from probabilities map for species to presence (suitable habitat) or absence (unsuitable habitat) map requires a specific threshold. In this study, the threshold determination method employed is SSE (Sensitivity–Specificity Equality)38.

Niche similarity analysis

We employs the COUE (Center shift, Overlap, Unfilling, and Expansion) framework to investigate ecological niche similarity between each mangrove species and Spartina alterniflora based on the ‘ecospat’ package within R statistical software (v 4.3.0)39,40,41. The 17 environmental factors were used to perform the principal component analysis (PCA). The first two axes of PCA were generated to represent the total ecological niche space occupied by the species in their respective habitats. Subsequently, the overall environmental space was partitioned into grid units, indicating unique environmental condition vectors observed at one or more locations in the geographical space. A kernel density function was applied to estimate the smoothed density of presence records and available environments along the first two axes of PCA. The total ecological niche space was then be divided into the three components: Unfilled niche space (U), Stable niche space (S), and Expanded niche space (E). U represents the niche space exclusively occupied by mangrove species; S represents the niche space concurrently occupied by both the mangrove species and Spartina alterniflora. E represents the niche space solely occupied by Spartina alterniflora.

Breadth ratio (BR), representing the ratio of the niche breadth of each mangrove species to that of Spartina alterniflora, is calculated as follows: BR = (U + S)/(E + S). When BR > 1 indicates that the mangrove species have a broader niche breadth compared to Spartina alterniflora, while BR < 1 indicates the opposite. BR = 1 specifies an equal niche breadth40. Niche Similarity Index (NSI) was also calculated to quantify the niche overlap between Spartina alterniflora and each mangrove species using the formula: NSI = 2 × S/(U + 2 × S + E). NSI > 0.5 indicates that S. alterniflora and mangroves occupied similar niche positions, and vice versa. NSI = 0.5 shows that they occupied the same niche positions40.

The D metric (D.overlap) is computed using a similarity test. D metric as41,

$$D = 1 - \frac{1}{2}\left( {\mathop \sum \limits_{ij} \left| {z_{1ij} - z_{2ij} } \right|} \right)$$

where z1ij andz2ij represent the standardized occupancy rates of two entities (e.g., species or populations) in environmental space grid cell (i, j), respectively. This metric ranges from 0 (indicating no overlap) to 1 (indicating complete overlap). D.overlap ranges from 0 to 1, where 0 indicates no ecological niche overlap between the mangrove species and Spartina alterniflora ranges, while 1 signifies complete overlap.

Key factors contribute to the difference between mangrove species and Spartina alterniflora

In order to assess the climatic similarity between mangrove species and Spartina alterniflora, we selected mangrove species with relatively high ecological niche similarity to Spartina alterniflora. We then extracted the environmental variables (bio1, bio8, bio14, bio15, bio19, ECE, sst03, sst05; see Table 1 for the explanation of the variables) corresponding to the present points of each mangrove species and Spartina alterniflora. These variables were chosen because they contributed more to the first two axes in the PCA analysis. Using a T-test, we compared the environmental differences between mangrove species and Spartina alterniflora, respectively. The results were visualized through violin and box diagram using R package “gghalves”, “ggsignif”, as well as “ggplot2”.

Results

Model elevation

The model credibility was evaluated using AUC (Area Under the Curve), with all values presented in Table 2 exceeding 0.8. This demonstrates high reliability of the separate distribution models for mangroves and Spartina alterniflora, confirming their suitability for analyzing spatial distribution patterns.

Table 2 Evaluation of modelling results.

Potential distribution of mangroves and Spartina alterniflora

Based on the distribution model of species (Fig. 3, Table 3), the results show that mangroves and Spartina alterniflora have a wide distribution area in coastal wetlands in China. Among them, the order of distribution area is Bruguiera gymnorrhiza > Excoecaria agallocha > Rhizophora stylosa > Acanthus ilicifolius > Lumnitzera racemose > Kandelia obovate > Aegiceras corniculatum > Avicennia marina > Spartina alterniflora > Acrostichum aureum. Although the potential distribution area is lower than many mangrove species, Spartina alterniflora has the widest latitudinal range (17.5387°). Among the mangrove species, the order in terms of latitude range is Kandelia obovate (12.6667°) > Excoecaria agallocha (8.0083°) > Avicennia marina (7.8583°) > Aegiceras corniculatum (7.3667°) > Bruguiera gymnorrhiza (6.5833°) > Acanthus ilicifolius (6.55°) > Rhizophora stylosa (6.5333°) > Acrostichum aureum (5.4083°) > Lumnitzera racemose (4.5°). In terms of cold tolerance, Spartina alterniflora > Kandelia obovate > Excoecaria agallocha > Avicennia marina > Aegiceras corniculatum > Bruguiera gymnorrhiza > Acanthus ilicifolius > Rhizophora stylosa > Acrostichum aureum > Lumnitzera racemose.

Fig. 3
Fig. 3
Full size image

Potential distribution of mangroves and Spartina alterniflora at the coastline of China. For a better overview, the line is shown separately for each species. The figure created in ArcGIS v10.4 (https://desktop.arcgis.com).

Table 3 Summary information on the spatial distribution features of the mangrove species and Spartina alterniflora addressed in this study.

The contribution of environmental variables on the distribution of mangroves and Spartina alterniflora is illustrated in Fig. 4. Spartina alterniflora distribution is primarily influenced by Distance to coastline (distance, 37.64%), Mean temperature of the wettest quarter (bio08, 11.41%), and elevation (11.24%). The response of mangrove community distribution to environmental factors varies partially depending on the species. Overall, distance to coastline (distance, 6.66–36.76%) and Mean temperature of the wettest quarter (bio08, 5.43–30.95%) play significant roles in all of the mangroves. However, for Lumnitzera racemosa, Annual mean temperature (bio01) initially contributes the most, at approximately 23.87%. In the case of Aegiceras corniculatum, elevation (14.57%) and Annual mean temperature (bio01, 8.80%) have a greater impact on its distribution compared to Mean temperature of the wettest quarter (bio08, 8.20%). For the distribution of Bruguiera gymnorrhiza, in addition to distance to coastline (distance, 16.99%) and Mean temperature of the wettest quarter (bio08, 12.20%), Electrical conductivity (ECE, 9.49%) and Mean diurnal range of SST (sst02, 9.18%) also play crucial roles.

Fig. 4
Fig. 4
Full size image

Contributions of environmental factors to mangroves and Spartina alterniflora. Notes: Annual mean temperature:bio01; Mean diurnal range:bio02;Isothermality:bio03; Max temperature of the warmest month:bio05; Mean temperature of the wettest quarter:bio08; Precipitation of the wettest month:bio13; Precipitation of the driest month:bio14; Precipitation seasonality:bio15; Precipitation of the coldest quarter:bio19; Distance to coastline: Distance; Electrical conductivity: ECE; Mean diurnal range of SST:sst02; Isothermality of SST:sst03; Max SST of the warmest month:sst05; Mean SST of the driest quarter:sst09.

Ecological niche similarity between mangroves and Spartina alterniflora

As shown in Fig. 5 and Table 4, the ecological niche differentiation degree between Spartina alterniflora and nine mangrove species is displayed. Ecological niche similarity analysis indicates that there is an ecological niche overlap between Spartina alterniflora and the mangrove populations (D.overlap > 0, NSI > 0). However, the degree of ecological niche overlap between different mangrove species and Spartina alterniflora varies (D.overlap: 0.015–0.24, NSI: 0.0444–0.551): Kandelia obovata > Aegiceras corniculatum > Avicennia marina > Excoecaria agallocha > Bruguiera gymnorrhiza > Acanthus ilicifolius > Acrostichum aureum > Lumnitzera racemosa > Rhizophora stylosa. The relative width of the ecological niche represents the ecological niche width of mangroves relative to Spartina alterniflora. The results indicate that the ecological niche width of Spartina alterniflora is much greater than all of the mangrove species (BR: 0.180–0.489). In the mangrove communites, the ecological niche width: Kandelia obovata > Aegiceras corniculatum > Lumnitzera racemosa > Acrostichum aureum > Avicennia marina > Excoecaria agallocha > Bruguiera gymnorrhiza > Rhizophora stylosa > Acanthus ilicifolius.

Fig. 5
Fig. 5
Full size image

(aj) Climatic niches of between mangroves and Spartina alterniflora. The green represents density of Spartina alterniflora, red shading represents density of mangroves, and blue shading represents overlapping ecological niches between them. (h) Principal component analysis distance biplot for the occurrences on 17 environmental variables (see Table 1 for the explanation of the variables). Arrows indicate the relative contributions of each climatic/environmental variables to the principal components.

Table 4 Ecological niche similarity between mangrove species and Spartina alterniflora.

The influence of environmental factors on the ecological niche differentiation between mangroves and Spartina alterniflora

The PCA of the 17 environmental factors identified two components that collectively explained 67.1% of the variance in environmental factors in the study area (PC1: 43.5%; PC2: 23.6%). Variables with the highest loading scores on PC1 were Annual mean temperature (bio1), ECE, Isothermality of SST (sst03), and Max sea surface temperature of the warmest month (sst05). On PC2, the main influencing factors are Mean temperature of the wettest quarter (bio08), Precipitation of the driest month (bio14), Precipitation seasonality (bio15), and Precipitation of the coldest quarter (bio19) (Fig. 5h). Factors related to terrain such as distance, elevation, and slope have a relatively small impact on the ecological niche differentiation between mangroves and Spartina alterniflora.

Selecting four mangrove species with higher ecological niche overlap with Spartina alterniflora, differential analysis was conducted to explore the relationship between the ecological niche characteristics of mangroves and Spartina alterniflora and environmental factors. The results are shown in the Fig. 6. Key environmental factors causing the difference in ecological niches between mangroves and Spartina alterniflora are significantly different between most mangrove species and Spartina alterniflora. Annual mean temperature (bio01) and Mean temperature of the wettest quarter (bio08) in mangroves are significantly higher than in Spartina alterniflora. Most mangroves, with the exception of Kandelia obovata, show extremely significant differences from Spartina alterniflora in Precipitation of the driest month (bio14) and Precipitation seasonality (bio15). Precipitation of the coldest quarter (bio19) in mangroves is significantly lower than in Spartina alterniflora. Electrical conductivity (ECE) of mangroves is significantly higher than that of Spartina alterniflora, indicating that mangroves have higher salt tolerance than Spartina alterniflora. Isothermality of Sea Surface Temperature (sst03) and Maximum Sea Surface Temperature of the Warmest Month (sst05) are both higher in mangroves compared to Spartina alterniflora.

Fig. 6
Fig. 6
Full size image

The comparison of environmental factors between mangrove species and Spartina alterniflora distributed. Notes: * means P < 0.05, **means P < 0.01, *** means P < 0.001. The color represents the species. Annual mean temperature: bio01; Mean temperature of the wettest quarter: bio08; Precipitation of the driest month: bio14; Precipitation seasonality: bio15; Precipitation of the coldest quarter: bio19; Electrical conductivity: ECE; Isothermality of SST: sst03; Max SST of the warmest month: sst05.

Discussion

This study first quantified the distribution patterns of a wide range of mangrove species and Spartina alterniflora in China at the species level using Stacked Species Distribution Modelling (SSDM)27.The AUCs (Area Under the Receiver Operating Characteristic Curve) for the model results ranged from 0.822 to 0.984, demonstrating the reliability of the model outcomes. In addition, the ecological niche similarity between each mangrove species and Spartina alterniflora was assessed separately.

Our ensemble model showed that mangroves and Spartina alterniflora are distributed along the coastline. Bruguiera gymnorrhiza has the broadest potential distribution range in China, primarily found in the southern regions of Guangxi, Guangdong, Hainan, as well as the southern parts of Fujian and Taiwan. On the other hand, Acrostichum aureum has a relatively smaller potential distribution area in China, concentrated in some areas of Guangdong, Guangxi, and Hainan provinces. Additionally, this species has a narrower latitudinal range of approximately 5.4080˚. These results are consistent with the previous studies16,42,43. The latitude adaptability range primarily reflects a species’ climate adaptability, particularly its sensitivity to temperature44. Based on the temperature adaptability of mangroves, the mangrove species in this study are categorized into two types. Acrostichum aureum, Excoecaria agallocha, Bruguiera gymnorrhiza, Rhizophora stylosa, Lumnitzera racemose, Acanthus ilicifolius fall into the thermophilic widespread species category, while Kandelia obovata, Aegiceras corniculatum, Avicennia marina are classified as cold-tolerant widespread species45.Comparing thermophilic with cold-tolerant widespread species enables a comprehensive analysis of how distinct thermal adaptation strategies influence resistance to biological invasions. The results of this study demonstrate that Kandelia obovata exhibits the broadest latitude adaptability range and the northernmost potential distribution. Differently, northernmost edge of Excoecaria agallocha is larger than that of Aegiceras corniculatum, Avicennia marina. The result indicated that Excoecaria agallocha (26.1709 ~ 18.1626) also has low temperature tolerance. Furthermore, our results showed that the latitude adaptability ranges of all of the mangroves are significantly smaller compared to the latitudinal distribution range of Spartina alterniflora (from 39.2209 to 21.6722).

Environments and species interaction contribute to distribution of mangroves and Spartina alterniflora22. In this study, Mean Temperature of the wettest quarter (bio08), distance, and elevation are the primary factors for Spartina alterniflora. Specifically, bio08 represnets climatic factors, elevation reflects topographic characteristics, and distance is associated with both topographic and tidal dynamics. These findings underscore that the distribution of Spartina alterniflora is shaped by the interplay of climatic, topographic, and hydrological factors. For mangroves, key driving factors vary significantly at different species. For example, compared to its influence on the distribution of other mangrove species, Mean diurnal range (bio02) constituted the most significant factor affecting the distribution of Lumnitzera racemosa, accounting for 23.87% of the explained variance. Given the strong correlation between Mean Diurnal Range and latitude, this attribute likely elucidates why Lumnitzera racemosa exhibited the narrowest latitudinal distribution range (22.6626 ~ 18.1626) in this study, being predominantly confined to tropical regions. For Acanthus ilicifolius, Mean Temperature of the Wettest Quarter (bio08) plays a major role (> 30%). Species-specific traits result in varying degrees of adaptability within the same environment.For instance, while Avicennia marina (Potential Area: 30846 km2, Latitude range: 26.0209 ~ 18.1626) and Rhizophora stylosa (Potential Area: 57797 km2, Latitude range: 24.6959 ~ 18.1626) exhibit broader latitudinal ranges, their potential distribution areas are significantly smaller. This discrepancy is primarily attributed to the constraint imposed by distance from coastline (Distance), which limits the growth of Avicennia marina (> 35%). Totally, these results clearly indicates that understanding mangrove distribution characteristics solely at the community level is insufficient to provide comprehensive data support for the restoration and development of mangrove ecosystems. Accurate knowledge of the specificities between different species is necessary.

Due to differences in the interaction between species and their environment, there can be both differences and similarities in species niches. Ecological niche similarity analysis found that there is niche overlap (D.overlap > 0, NSI > 0) between all mangrove species and Spartina alterniflora. This indicated that potentially suitable environmental conditions for co-occurrence and competition exist across the range of these mangrove species with Spartina alterniflora. The degree of environmental niche similarity may indicate the potential extent of overlap in suitable habitat, and higher similarity might highlight species and areas that are environmentally more vulnerable to Spartina alterniflora establishment, should dispersal, biological interactions, and disturbance facilitate invasion. Our findings suggest Kandelia obovata shows the highest degree of environmental overlap, potentially indicating a higher environmental risk. This aligns with observations of Spartina alterniflora invasion in areas where Kandelia obovata is present46. Additionally, Aegiceras corniculatum, Avicennia marina, and Excoecaria agallocha are also relatively susceptible to invasion by Spartina alterniflora. It is noteworthy that the species with the highest overlap in ecological niches with Spartina alterniflora happens to be the northernmost distributed mangrove species, mainly in Fujian Province.

On the other hand, Principal component analysis (PCA) revealed the environmental factors contributing to the differences in ecological niches between mangroves and Spartina alterniflora. The analysis demonstrated that climatic variables, including Annual Mean Temperature, Isothermality of Sea Surface Temperature, Maximum Sea Surface Temperature of the Warmest Month, Mean Temperature of the Wettest Quarter, Precipitation of the Driest Month, Precipitation Seasonality, and Precipitation of the Coldest Quarter, collectively explained 67.1% of the observed niche divergence (PC1 + PC2). As most of these (except salinity) are climate-related, the PCA primarily highlights the role of climate variability and extremes in separating the niches. This highlights the dominant role of climatic variability and extremes in shaping niche differentiation. Thus, under relatively stable climatic conditions (e.g., low interannual fluctuations in temperature and precipitation), niche similarities between these species may be primarily driven by shared requirements for physical substrates, such as soil properties (e.g., nutrient enrichment) or topographic features. This aligns with previous studies demonstrating that soil eutrophication (a substrate-related factor) accelerates S. alterniflora invasion by enhancing its competitive advantage in resource acquisition47. Notably, environmental comparisons showed that three mangrove species with high ecological niche similarity to Spartina alterniflora differed significantly from it, except for Kandelia obovata. Kandelia obovata does not display significant differences from Spartina alterniflora in Precipitation of the driest month and Precipitation seasonality. suggesting their niche convergence is largely attributed to adaptive convergence to precipitation regimes. This results is consistent with the previous study, which reported that rainfall and salinity regimes affect growth and competitive interaction of salt marsh and mangrove48. Climate change may alter this dynamic. For instance, intensified drought (reduced Precipitation of the Driest Month) could weaken Kandelia obovata’s competitive edge, while increased precipitation variability (higher Precipitation Seasonality) might favor S. alterniflora’s clonal expansion, exacerbating niche overlap. Consequently, under conditions of variable precipitation, strengthened conservation efforts for Kandelia obovata are essential.

This study quantifies the climate-environmental niches of major mangrove species and Spartina alterniflora at the species-level in China, and compares the niche similarities between mangroves and Spartina alterniflora. This provides data support for promoting mangrove restoration and development, as well as inhibiting Spartina alterniflora invasion. However, it is necessary to mention that this study has certain limitations. Firstly, this study assumes that niche overlap implies competitive exclusion, leading to the decline of native species, and infers that Spartina alterniflora invasion may occur against different mangrove species. However, niche overlap does not necessarily lead to competitive exclusion. Species can coexist through niche differentiation (e.g., differences in functional traits, different spatial utilization strategies). Therefore, future niche overlap analysis should incorporate studies of functional traits or niche differentiation to more accurately understand interspecies relationships and ecological coexistence mechanisms. What’s more, our environmental niche maps identify high-risk zones (e.g., Fujian coast with K. obovata) where such experiments could be prioritized to disentangle competition dynamics. Secondly, while our model quantifies niche overlap, the absence of explicit interspecific competition parameters (e.g.,dispersal barriers) may underestimate invasion resistance. Future studies should integrate competition indices into SDMs. Thirdly, with increased data availability and advanced technology in SDMs, ensemble species distribution models can be considered a dependable technical tool. Using integrated methods to combine and average models is believed to decrease model uncertainty and enhance its robustness in precisely modelling different species distributions49,50. Comparing the results of S. alterniflora distribution model in this study and the MaxEnt based model26, we found that the AUC value of ensemble species distribution model was lower than MaxEnt model, which indicates that the ensemble species distribution model is not necessarily better than the single algorithm simulation results. Many studies investigating the efficiency of species distribution models have obtained results similar to this research51,52. While the assessment outcomes of both models may be considered reliable, the results of ensemble species distribution models may not necessarily surpass those of single algorithm models51,53. For example, Kaky et al.53 based on Egyptian medicinal plants also found that Ensemble modelling, MaxEnt and Random Forest achieved the highest predictive performances, while support-vector machine and classification and regression trees had the poorest performance. This indicates that the appropriate model should be selected according to the research purpose and scope of the study, so as to ensure the effectiveness of the model and improve the simulation efficiency at the same time.

Conclusion

Global warming and sea level rising have the potential to modify plant species habitats and ranges, increasing the likelihood of extinction5,54. While endemic species with narrowly defined ranges, increased adult threats, smaller population structures, and heightened habitat specificity are particularly vulnerable to changes in their ranges, habitat degradation or loss, and may face potential extinction in the near future. Accurately forecasting current and future distributions through Species Distribution Models (SDMs) is vital when designing diverse strategic approaches to habitat conservation and management55,56,57. This study employs an ensemble species distribution model (ESDM) to quantify the ecological niche characteristics of nine major mangrove species and Spartina alterniflora in China. We found that within the mangrove community, Bruguiera gymnorrhiza has the largest potential distribution area in China (Potential Area:74729km2, Latitude range: 24.7459 ~ 18.1626°N), while the latitude range of Kandelia obovata is the widest(Potential Area: 45588km2, Latitude range: 30.8543 ~ 18.1876°N). That is to say Kandelia obovata has wide climatic adaptability and Bruguiera gymnorrhiza is good at Topography. Additionally, this study confirms that Spartina alterniflora has a wide range of suitable habitats in China and exhibits strong niche similarity with mangroves, particularly with Kandelia obovata and Lumnitzera racemosa. Therefore, in mangrove conservation projects, it is crucial to enhance the protection of Kandelia obovata and Lumnitzera racemosa, and intensify the removal of Spartina alterniflora around these species. These actions are effective measures to promote the protection and restoration of mangrove ecosystems. In summary, our integrated species distribution model provides robust support and assessment for estimating potential distribution range changes of mangrove species and Spartina alterniflora, offering essential data support for the restoration and management of coastal wetlands.