If you want to achieve it directly from database, you can write a query to retrieve position records between the required time-stamp and write a simple if loop which will check a combination of time difference between each position record along with ignition status (if available) or motion status.
If you require to do it via API, it is already available, you just need to optimize your configuration using the documentation to match your required criterias. and you can use the reports api and retrieve trips detail.
However as you have already mentioned you want to do it with the records from database. You can confirm the same, and I can share some previous PHP -> MySQL reports I had done. which maybe could be of help.
Hello James, thanks for the quick reply, looking for something in github I found your repository traccar-api-php where I could observe how it is done through api as you commented, I think this way it is easier to reproduce the reports.
The logic of your api already helps me a lot, I think it will suffice, thank you for sharing!
Thats Great. You are most welcome.
I am using the Traccar api to receive device data, however I am interfacing with php to manipulate the information, at this point in the project I am working with the Trip report and I am not able to determine travel snippets.
Data in position table:
I have a lot of information in this tutorial, but I could not build an algorithm with the data.
Motion, Trips and Stops