trips query

sicksand8 years ago

hi,

thanks for a great software. i'm just using traccar(3.7) for backend only and developing the frontend. Java is not my forte. My questions is, how do I calculate trips from query (MySQL) only? is it the combination of 'positions' and 'events' table. Can I use 'events' table and the detail query can be pick up from 'positions' table.

Thanks

Anton Tananaev8 years ago

It is calculated based on the positions table only.

sicksand8 years ago

are there any specific query that can you share?

sicksand8 years ago

I have read the code in here : https://github.com/tananaev/traccar/blob/master/src/org/traccar/reports/Trips.java

But how do i get the value of endIndex and startIndex in query of mysql. I can get only the list of position based on fixtime only "select fixtime,address,speed from positions where fixtime BETWEEN '2016-11-19 00:00:00' AND '2016-11-19 23:59:59';" but on what indicator says that this is the start and the end. and also how to get list of trips if device made many trips.

Thanks.

Anton Tananaev8 years ago

It's in the same class. Check "detectTrips" method.

sicksand8 years ago

EDIT:

Just found out in the site. sorry.

Hi Anton,

In what value do i have to key-in in traccar.xml?

report.trip.minimalTripDuration - is it in time? seconds is equal to 1 = 1 second?
report.trip.minimalTripDistance - is it in km or kn
report.trip.minimalParkingDuration - is in time?

abyss8 years ago

Hello,

report.trip.minimalTripDuration in seconds
report.trip.minimalTripDistance in meters
report.trip.minimalParkingDuration in seconds