LLMTrajQuery: an LLM-based generative approach to semantic trajectory queries
Shutong Yu, Junnan Liu, Chenchen Gao, Weifan Niu, Xuan Guo, Haiyan Liu, Mingliang Xu · International Journal of Geographical Information Systems · 2025
To express complex query requirements and intentions, natural language has become the preferred way due to its intuitiveness. LLM is a powerful semantic parser for natural language queries. To facilitate intelligent and user-friendly trajectory queries, we proposed an LLM-based generative approach to semantic trajectory queries (LLMTrajQuery). This approach includes a new method named trajectory textualization, which converts numerical trajectories into semantic descriptions by segmenting trajectories, extracting semantics, and constructing documents. The subsequent phase, semantic trajectory query, refines query specifications, retrieves and reorders the extracted semantic trajectories, and generates natural language responses. Finally, multiple experiments demonstrated the advantages of LLMTrajQuery in improving precision and relevance and verified its robustness and scalability. Overall, LLMTrajQuery enables users to retrieve trajectories through natural language queries and receive natural language responses corresponding to numerical trajectory data and user queries.