DSF22 issues

On the other server, there is an angle, not sure if it is from the device but you can see where it heading >> https://ibb.co/WB0ZY0r

Anton Tananaev3 years ago

Wonder where they get it from. Because the documentation you provided doesn't have anything about it. Wrong/incomplete documentation?

I do not know. I provided all I got. I will ask if there is something missing.

I asked and they said: there is no data from the devices but it has to be done on the server-side angle must be calculated by the server using the last two positions.

Anton Tananaev3 years ago

We don't do that currently. It would be very inaccurate way of calculating it.

I did not want to ask for all explanations because they said it is very easy to do that.

maybe you can use this code Calculate the angle between two Latitude/Longitude points

private double angleFromCoordinate(double lat1, double long1, double lat2,
        double long2) {

    double dLon = (long2 - long1);

    double y = Math.sin(dLon) * Math.cos(lat2);
    double x = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1)
             Math.cos(lat2)  Math.cos(dLon);

    double brng = Math.atan2(y, x);

    brng = Math.toDegrees(brng);
    brng = (brng + 360) % 360;
    brng = 360 - brng; // count degrees counter-clockwise - remove to make clockwise

    return brng;
}