FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

4167 questions

4739 answers

3460 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
3,123 views
in Vehicle tracking by anonymous

Hello,

I got correctly decimal Longitude & Latitude values, and now I try to calculate GPS coordinate, in manual, we can see:

# # #

If longitude is in west or latitude in south, multiply result by –1. To determine if the coordinate is negative, convert it to binary format and check the very first bit. If it is 0, coordinate is positive, if it is 1, coordinate is negative. Example:

Received value: 20 9c ca 80 Converted to BIN: 00100000 10011100 11001010 10000000 first bit is 0, which means coordinate is positive Converted to DEC: 547146368 For more information see two‘s complement arithmetics.

# # #

When I test the same decimal : 547146368 * 0.0000001 I got  54.714636 (correct value). Then I check first bit (from left) to add or no negative sign (-).

But when I test another decimal (from Google Map) : 50895408 * 0.0000001 I got 5.08954 (not correct value) instead of  50.895408.

So multiplication theory (* 0.0000001) is not correct or not complete. How can resolve that easily please ?

Thank you.

by anonymous
You must divide it by 10_000_000

because in calculating coordinate it multiplied with 10_000_000

5 Answers

0 votes
by anonymous
Hello,

Thank you for query.

Example described by you only works with coordinate values obtained from our FM devices. Values from other sources (like Google maps) may have less decimal spaces or numeral figures, therefore this method can not be used.

Hope this helps,

Best regards.
0 votes
by anonymous
Hello,

Thank you for your clear response but what is the solution ?

So, how can I show your decimal values in Google Map ?

Exemple 547146368 (Decimal value from FM Device), how can I transform this value for Google Map ?

I use Google Map API and when I try to insert FM devices decimals values I got error (coordinates are not valide).

Are you understand what I mean ?

Thank you.
by anonymous

Hello,

Coordinates that are sent with AVL packet are being implemented on the server side. On device side coordinates structure is not customizable. There is no such documentation on how to implement device coordinates to Google Maps API. Or if it is possible to make one more multiplier by 10 in order to get coordinate which will match Google's value. Or  i.e  (50895408 * 0.0000001)*10 or if you receive 50895408 you can try multiplying it by 0.000001 on your server side (If possible*). 

Best regards.

by anonymous

Hello,

Thank you for your help,

Sure, on device side coordinates structure is not customizable.

I'm looking for a solution only on server side (so no problem with device),

Exactly, no such documentation on how to implement device coordinates to Google Maps API, that's why I try to transofrm decimals values.

About your proposition, of course, if I calculate (50895408 * 0.0000001)*10 I got 50.895408 but it does not work in all cases.

May be I get another decimals (123.12345678 or 1234.12345 or 123.12345678911) depends on the geographical position.

I hope someone can help me :(

Thank you.

by anonymous

Hello,

Someone can help me to convert decimal value to DD (Decimal Degrees) please crying ?

by anonymous

  Uuuuuppppppppp frown         

0 votes
by anonymous
Hi,

The main thing is you can't test a random decimal number with this formula.

If you want to test , take a real raw data from the teltonika device (The data which teltonika sent to the server) and test.

If you want to test GPS data from around the globe, you need to take teltonika raw data from those places not some random decimal values.

Please find some RAW data from UAE for your reference.

213A7B400F012C700076006D0C0078 - 15 Byte GPS element

20EB2FC00EFC4310002400000A0000 - 15 Byte GPS element

Thanks

Naveen
0 votes
by anonymous

Hello,

I didn't tested random decimal number crying

Numbers used in my post are a real numbers extracted from packet (GPS Element) received from a real device and converted from Hexa to Decimal.

I'll explain my problem in a simple way :

As you see, I use the same example found in the protocol document.

How you convert 252618832 To => 25,2618832 ?

Thank you very much yes

0 votes
by anonymous

Hello Naveen,

What do you think about my question please ?

I didn't tested random decimal number crying

Numbers used in my post are a real numbers extracted from packet (GPS Element) received from a real device and converted from Hexa to Decimal.

I'll explain my problem in a simple way :

As you see, I use the same example found in the protocol document.

How you convert 252618832 To => 25,2618832 ?

Thank you very much yes

by anonymous
Hi,

Long time, but have you found the solution?

Thx