Accurately mapping soil organic carbon (SOC) is conducive to evaluating carbon storage and soil quality. However, the high spatial heterogeneity of SOC caused by river-related factors and agricultural management brings challenges to digital soil mapping in floodplain farmland. Moreover, current studies focus on the non-linear relationship between SOC and covariates, but ignore the effective range of environmental variables on SOC, which prevents the revelation of the SOC differentiation mechanism. Using the 375 samples collected from the Jiangchang Town near Han River, we aim to determine the main controlling factors of SOC, reveal the effective range of environmental variables, and obtain the spatial map of SOC by using the gradient boosting decision tree (GBDT) model and partial dependence plots. Linear regression was used as a reference. Results showed that GBDT outperformed linear regression. GBDT results show that the distance from the river was the most important SOC factor, confirming the importance of the Han River to the SOC pattern. The partial dependence plots indicate that all environmental variables have their effective ranges, and when their values are extremely high or low, they do not respond to changes in SOC. Specifically, the influential ranges of rivers, irrigation canals, and rural settlements on SOC were within 4000, 200, and 50 m, respectively. The peak SOC was obtained with high clay (≥31%), total nitrogen (≥1.18 g/kg), and total potassium contents (≥11.1 g/kg), but it remained steady when these covariates further increased. These results highlight the importance of revealing the effective range of environmental variables, which provides data support for understanding the spatial pattern of SOC in floodplain farmland, achieving carbon sequestration in farmland and precision agriculture. The GBDT with the partial dependence plot was effective in SOC fitting and mapping.