Software and Software Development > Other 3rd Party Software

Interpreting Latitude and Longitude in SON files?

(1/2) > >>

adriank:
Hi All

I've been trying to build a batch converter to extract tracks and depths from several hundred DAT/SON files that I have. The info from this post http://forums.sideimagingsoft.com/index.php?topic=16.0 has been pretty much exactly what I need except for the interpretation of the Latitude and Longitude values. Using the byte map in the above thread I've been converting the Lat/Lon bytes using Int32 and getting values like Lon: 16226043 Lat: -4557743. I know they equate to 145.75528834210039 and -38.032398555522214 but don't know the conversion function or even if I'm doing the byte conversion correctly (I do the bit swap from Big to Little endian).

The DAT files come from a 998c HD SI Combo.

Anyone out there have the answer?

Adrian

RGecy:
Adrian, of course I have the answer! ;D

I will post the code here tomorrow when i can.  The unit stores the coordinates in UTM not lat lon.  There are several good sources on the net that have these formulas, but getting the correct one can be tricky.  The datum multiplier is key to getting precise conversions.  Have a look at the webpage below and see what you think about the math.  ::) ::)

http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system


Robert

adriank:
ah Robert you're a legend . I had an idea they were in UTM but the numbers weren't right and there was no zone. Found some useful code at http://bb.sideimageforums.com/viewtopic.php?p=485 but that conversion was out by 0.7degrees.

Cheers

Adrian

adriank:
OK I can refine my problem a little more. I have code which coverts UTMtoDeg and DegtoUTM which works fine. The main issue I'm having is that the N & E from the SON file don't resemble the N & E for the true coordinates. I'm either converting them from bytes wrong or there is something done to the values before feeding them into the UTMtoDeg conversion. I'm assuming the UTM Zone is from common knowledge as I don't see it in the SON read out. So here is an example:

When I convert the SON bytes to Int32 I get N: -4557743 (position 20-23) and E: 16226043  (position 15-18)
The coordinates they should convert to is Lat: -38.03239969 Lon: 145.7552883 which in UTM is actually N: 5789858.812 (Raw N: -4210141.188) and E: 390763.6466 for Zone 55

So I guess what I need is the process to get those SON N&E correct before I convert to Lat/Lon.

Hope this makes it a bit easier to solve.

Adrian


RGecy:
Might want to check how you are doing the bit swap.  You said from big to little endian, but the file is stored in big endian. 

So I would assume you are reading in litlle endian and converting to big endian.

Robert

Navigation

[0] Message Index

[#] Next page

Go to full version