I have a GPS device that sends data to my server, I need to convert the decimal values ββthat the device sends to latitude and longitude. I am not good at math, so all my attempts have failed, here are the specifications:
Latitude
Occupy 4 bytes representing the value of latitude.
The range of numbers is from 0 to 162000000, which represents a range from 0 Β° to 90 Β°. Unit: 1/500 second Conversion Method:
A) Converting latitude data (degrees, minutes) from the GPS module into a new form, which represents the value in minutes only;
B Multiply the converted value by 30000, and then convert the result to a hexadecimal number
For example, 22 Β° 32.7658 ', (22 Γ 60 + 32.7658) Γ 30000 = 40582974, then convert it to hexadecimal number 0x02 0x6B 0x3F 0x3E
longitude
Occupy 4 bytes representing the longitude value of the location data. The number ranges from 0 to 324000000, representing a range from 0 Β° to 180 Β° .Unit: 1/500 seconds, the conversion method matches the latitudes.
I came up with this function, but it does not work:
procedure GetDegree(const numar : DWORD; out min,sec : Extended); var eu : Extended; begin eu := numar / 30000; min := Trunc(eu / 60); sec := eu - min * 60; end;
source share