473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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.

Expand|Select|Wrap|Line Numbers
  1. 4adac812 = 74°26.2851' = 74.438085
  2. 2b6059f9 = 43°0.2763'  = 43.004605
  3.  
  4. 4adaee12 = 74°26.3003' = 74.438338
  5. 2a3c8df9 = 42°56.3177' = 42.938628
  6.  
  7. 4ae86d11 = 74°40.1463' = 74.669105
  8. 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.
Feb 25 '11 #1
2 16565
jkmyoung
2,057 Expert 2GB
It's actually really simple. Take the binary value and divide by 0x01000000.
Multiply the decimal part by 60 (60 minutes in a degree)
Mar 28 '11 #2
@jkmyoung
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
Expand|Select|Wrap|Line Numbers
  1. 0x4adaee12 = 74°26.3003' = 74.438338
  2. hex 0x4adaee12 -> int 1255861778
  3. hex 0x01000000 -> int 16777216 (2^24)
  4. 1255861778 / 16777216 = 74,8551951647
  5. 74,8551951647 % 74 = 0,8551951647
  6. 0,8551951647 * 60 = 51,3117098808
  7.  
would be nice to get a correction.

br
thomas
Nov 28 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Thomas Richards | last post by:
Can anyone please tell me if it is possible to bcp in a file with hex data into SQL Server 2000? I have a file that the characters appear as blocks when viewed in notepad but appear as hex...
6
by: Danny | last post by:
There must be a way to convert the binarydata field in the SQL trace output to text data when the event type is a show plan. SQL Profiler does it but how can it be done from an imported table? ...
7
by: Niyazi | last post by:
Hi, I developed an application and I am using SQL Server 2000 developer edition. I create my database and I have also created tbl_USER table. I have an ID, RealName, UserName, and UserPassword...
4
by: Tiraman | last post by:
Hi , I Would Like To Convert Some HEX Data to string format and opposite . does vb.net has some functions for that ? 10x -- Best Regards ,
2
by: kbperry | last post by:
I am not sure if this is the right place for this, but I thought it was worth a shot. What I want: Enter a From: street address and a To: street address, and then specify an interval (say...
6
by: helpneeded | last post by:
Hi I am a novice using the <maptag. I have a question. I would really appreciate if you could answer me. I want to use the <maptag to dynamically update my map with coordinates. These...
1
by: Swan | last post by:
I am sending binary data from ASP to dll in VB.I am able to receive the data,but it is in binary format.can anybody plz tell me how to convert binary data to original text in VB.(I am saving data in...
22
by: xiao | last post by:
Can I fullfill this task? Using fred and fwrite?
1
by: jikor | last post by:
I would like to ask how to convert intel hex file to binary? any suggestion?
2
by: RV311 | last post by:
Hello All, How can we convert the text data present in XML to binary data?I have come across links that shows how to do the same using C#.It would be of great help if I get to know about...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.