With the widespread application of positioning devices in agricultural machinery, a massive amount of trajectory data has been generated. Classifying field and road trajectories in the trajectory data is the foundation of agricultural machinery operation analysis. However, the existing methods for field-road trajectory classification suffer from an imbalance between high accuracy and computational efficiency, making them unsuitable for real agricultural machinery operation scenarios. To address this issue, this paper proposes an efficient field- road trajectory classification method for agricultural machinery by integrating spatio-temporal clustering and semantic segmentation. The method consists of three stages: trajectory preprocessing, trajectory clustering and trajectory segmentation. Firstly, four preprocessing operations, namely null filling, attribute filtering, speed cleaning and linear interpolation, are applied to eliminate abnormal trajectory points and complete missing trajectories. Secondly, a spatio-temporal nearest neighbor trajectory clustering method is introduced, grouping trajectories using positional, temporal, and directional information while excluding long-distance road trajectories. Finally, an improved U-Net model is proposed for trajectory image segmentation, incorporating a convolutional block attention module (CBAM) and a focal loss function. This model achieves segmentation of field trajectories, drifting trajectories and close-to-field road trajectories within each trajectory group. The results demonstrated that our method achieved an average accuracy of 96.32% and an average F1-score of 94.29% on the Intelligent Agricultural Equipment Management Platform Dataset (IAEMPdataset), and an average accuracy of 92.03% with an average F1-score of 90.41% on the Precision Agriculture Application Project Data Service Platform Dataset (PAAPDSPdataset), outperforming existing classification methods. For both datasets, the average inference time for each trajectory data sample was 4.08 sand 6.61 s, respectively, surpassing the latest classification methods in terms of the highest accuracy. In field trials, our method achieved over 97% accuracy in the operation area when integrated with the operation area calculation application. Moreover, the average efficiency of the single-thread integrated operation area calculation exceeded 3 mu per second, meeting engineering practice requirements.