1

How to get a unit position given an old timestamp

Тема: How to get a unit position given an old timestamp

How to get a unit position given an a timestamp,
the current option is that you can get the unit then use the

unit.getPosition();

is there is any way to code

unit.getPosition(timestamp);

then it will return for you the position at that time stamp

2

How to get a unit position given an old timestamp

Re: How to get a unit position given an old timestamp

Hi!

Method getPosition() returns only the last postion.
If you need to get history points, you need to load messages, then get position from them
Please looks example here - https://sdk.wialon.com/playground/demo/get_messages

Diana Cheley
Wialon Hosting Expert
Gurtam
3

How to get a unit position given an old timestamp

Re: How to get a unit position given an old timestamp

chdi пишет:

Hi!

Method getPosition() returns only the last postion.
If you need to get history points, you need to load messages, then get position from them
Please looks example here - https://sdk.wialon.com/playground/demo/get_messages




I have loaded the message and I have used this method,

but what if the specific timestamp that I am targeting has no message event in it of any kind then I can't get the right location.

which is what happened to me, so I have to get the events in larger interval to approximate the position which gives inaccurate position and unit might have traveled long distance then made another event message that has the position info in it.

What do you think ??????

4

How to get a unit position given an old timestamp

Re: How to get a unit position given an old timestamp

Hello!

You can analyze the massive the message and select nearest one to time stamp in order to your own algorithm.

Or you can use the following APi request to get nearest messages from track layer - https://sdk.wialon.com/wiki/en/sidebar/ … ttest_time
How to load track layer : first get renderer (  getRenderer() method ) , than create message layer - createMessagesLayer() method.  Please look example here https://sdk.wialon.com/playground/demo/unit_track

Diana Cheley
Wialon Hosting Expert
Gurtam