what is the api function for getting distance from previous lat,lng position to current lat,lng position

Primtek7 years ago

Hello,

what is the api function for getting distance from previous lat,lng position to current lat,lng position

Anton Tananaev7 years ago

You need to use position endpoint to get distance.

Primtek7 years ago

Hi..
do you mean api/positions ? (https://www.traccar.org/api-reference/#path--positions)
if so, I did not find 'endpoint' property to get the distance..

I tried the following:

http://demo5.traccar.org:5055/api/positions/?id=113460&from=2018-03-07 T14:58:35&to=2018-03-07 T14:58:35&id=113460

it shown empty

Anton Tananaev7 years ago

Endpoint is not a property. It's an API endpoint.

Obviously you won't get anything useful if your from and to values are the same. I would recommend you to try without any parameters.

Primtek7 years ago

I tried without parameters as follow:

http://demo5.traccar.org:5055/api/positions

but it returns http error 400

does it use port 5055?
does the address correct?

Anton Tananaev7 years ago

No. I would recommend you to look at what official web app sends before asking any questions.