How to convert my binary (hex) data to latitude and longitude?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DarkSerg
    New Member
    • Feb 2011
    • 1

    How to convert my binary (hex) data to latitude and longitude?

    Hi!

    I have some binary data stream which passes geo location coordinates - latitude and longitude. I need to find the method they are encoded.

    Code:
    4adac812 = 74°26.2851' = 74.438085
    2b6059f9 = 43°0.2763'  = 43.004605
    
    4adaee12 = 74°26.3003' = 74.438338
    2a3c8df9 = 42°56.3177' = 42.938628
    
    4ae86d11 = 74°40.1463' = 74.669105
    2afd0efb = 42°59.6263' = 42.993772
    1st value is hex value. 2nd & 3rd are values that I get in output (not sure which one is used in conversion).

    I've found that first byte represents integer part of value (0x4a = 74). But I cannot find how decimal part is encoded.

    I would really appreciate any help!
    Thanks.
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    It's actually really simple. Take the binary value and divide by 0x01000000.
    Multiply the decimal part by 60 (60 minutes in a degree)
    Last edited by jkmyoung; Mar 28 '11, 06:54 PM.

    Comment

    • thomas050903
      New Member
      • Nov 2011
      • 1

      #3
      Originally posted by jkmyoung
      It's actually really simple. Take the binary value and divide by 0x01000000.
      Multiply the decimal part by 60 (60 minutes in a degree)
      Hi google helped me finding this thread. I am having the same issue.
      unfortunetly the given solution is too apstract for me.

      staying at one given sample I understand this: step by step
      Code:
      0x4adaee12 = 74°26.3003' = 74.438338
      hex 0x4adaee12 -> int 1255861778
      hex 0x01000000 -> int 16777216 (2^24)
      1255861778 / 16777216 = 74,8551951647
      74,8551951647 % 74 = 0,8551951647
      0,8551951647 * 60 = 51,3117098808
      would be nice to get a correction.

      br
      thomas

      Comment

      Working...