Urban environmental policies need to be rectified considering the spatioemporal variations of traffic emissions. However, knowledge to support such a decision-making process is insufficient. This study analyzes the spatiotemporal distributions of traffic emissions in the built environment and their potential nonlinear associations. Considering the recent innovations in machine learning, a tree-boosting algorithm combined with Gaussian process and random effects models (GPBoost) is applied using the big GPS taxi data from Dalian, China. The nonlinear relationships between built environment variables and traffic carbon (CO2) emissions are interpreted using the SHapley Additive ExPlanation (SHAP). It is found that the proposed GPBoost model that considers spatial heterogeneity enhances the overall predictive power compared to traditional machine learning models. Most of the built environment variables have a nonlinear relationship with traffic carbon emissions and the threshold effects vary over time, indicating the necessity of dynamic urban management.