Quote:
Originally Posted by _Dejan_
zorro thaks for help.
I have NMEA specification... But I need help how to parse/calculate driving direction from it. Like we receive it if we call CF_GPSInfo("DIRECTION")...
|
So, you mean the formated string "N", "W", "E", "S" ... and so on?
First create a string like this:
Code:
private readonly string[] directions = new[] { "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "N", "NNE", "NE", "ENE" };
Then take the degree from VTG and convert it like this:
Code:
int dir = (int)(degree/22.5f);
if (dir >= 0 && dir < 16)
return directions[dir];