With the popularity of various portable mobile devices with positioning functions, a large amount of spatial‐temporal trajectory data has emerged. To effectively compress large‐scale vehicle trajectory data and serve intelligent transportation system, we propose a spatial‐temporal trajectory data compression algorithm based on vehicle motion pattern recognition. The algorithm recognizes vehicles' turning behaviour and variable speed behaviour during the driving process through the analysis of vehicle motion patterns, and extracts the trajectory's turning feature points and variable speed feature points, so as to achieve online compression of the vehicle trajectory. By means of large‐scale experimental datasets, the authors compare this algorithm with representative trajectory compression algorithms in various performance metrics. The experimental results indicate that as an online vehicle trajectory compression algorithm, the proposed algorithm is superior to representative compression algorithms in compression accuracy and computational efficiency, and the compression results can reflect semantic motion information such as turning patterns and variable speed patterns in the trajectory. Therefore, this algorithm has comprehensive advantages, which is foundational for trajectory data mining in intelligent transportation systems.