Monitoring and restoring soil quality in areas neighboring roads affected by traffic activities require a thorough investigation of heavy metal concentrations. This study examines the spatial heterogeneity of copper (Cu) and chromium (Cr) concentrations in a 0.113 km² area adjacent to Jin-Long Avenue in Wuhan, China, using Unmanned Aerial Vehicle (UAV)-based hyperspectral remote sensing technology. Through this UAV-based remote sensing technology, we innovatively achieve a small-scale and fine-grained analysis of soil heavy metal pollution related with traffic activities, which represents a major contribution of this research study. In our approach, we generated 4375 spectral variates by transforming the original spectrum. To enhance result accuracy, we applied the Boruta algorithm and correlation analysis to select optimal spectral variates. We developed the retrieval model using the Gradient Boosting Decision Tree (GBDT) regression method, selected from a set of four regression methods using the LOOCV method. The resulting model yielded R-square values of 0.325 and 0.351 for Cu and Cr, respectively, providing valuable insights into the heavy metal concentrations. Based on the retrieved heavy metal concentrations from bare soil pixels (17,420 points), we analyzed the relationship between heavy metal concentrations and the perpendicular distance from the road. Additionally, we employed the universal kriging interpolation method to map heavy metal concentrations across the entire area. Our findings reveal that the concentration of heavy metals in this area exceeds background values and decreases as the distance from the road increases. This research significantly contributes to the understanding of spatial distribution characteristics and pollution caused by heavy metal concentrations resulting from traffic activities.