1

My question is an extention to Converting mercator meters without UTM zone?

While the answer in the previous Q&A got me so far, I've now come to an impass. While the conversion I do from Mercator metres to lat/long works, I don't get the accuracy that I've seen possible with other programs. I've posted this query on a more dedicated forum (http://forums.sideimagingsoft.com/index.php?topic=7785.0) but haven't had any feedback so would like to see if the wider community may be able to help.

Here is the basic post I had on the other forum:

I've been working on extracting the header information from the raw SON files from a 998c SI unit. I have hundreds of recordings so I'm aiming to create a batch extraction of depth and coordinate information. I've been successful at getting out the information from the SON files but the final stumbling block is once again the handling of the coordinates. I now know that the Sonar writes the coordinates in World Mercator metres (EPGS: 3395). Unfortunately when I use some spatial transformation libraries (GDAL and ProjNet) the conversion to lat/lon is never accurate enough. I know it is possible to get a very accurate conversion as HumViewer and HBSI Sonar File Converter both produce accurate points with HumViewer the most accurate. Here is a graphic of the various coordinates converted from the same Mercator Meter coordinates 16044360, -4228674.

Difference in coordinate transformation results

So my question is, what is being done to the raw data to improve its accuracy? According to 'hydrograph' in this thread http://bb.sideimageforums.com/viewtopic.php?t=118&highlight=source+code there probably is some independent axis shift calculation being used. Anyone have an idea what this might be? I don't mind going back to basics and coding my own transformation function but I'm not keen if I'm going to get the same result as other transformation libraries without incorporating the independent shift, if required.

If it's any help to anyone I've attached the header structure from the 998c SI.

binary map of Humminbird SON file

Here are a couple of lines data from B000.SON but I don't think the adjustment needed is in it.

example data extracted from SON file

  • 2
    Since one would expect that GDAL (or any GIS for that matter), correctly used, would produce sub-centimeter accuracy, I have to press you on why you know the other software is "more accurate." What evidence do you have for that? – whuber Oct 10 '14 at 0:22
  • 3
    Whatever you're using in GDAL isn't EPSG:3395. When I check with the Esri projection engine, the result matches ProjNet. – mkennedy Oct 10 '14 at 0:34
  • @whuber I know the other software is producing accurate results as I've stood where the point is located. I know that GDAL, ProjNet and others are very accurate which is why I suspect (and refered to hydrograph comment in link) there is some sort of 'Humminbird' adjustment to the binary coordinates before transform. I was hoping that someone out there might know or guess how that is done. – adriank Oct 12 '14 at 23:29
  • @mkennedy You're spot on. It seems that ProjNet and ESRI only have the option of, or revert to, ESRI/EPSG:54004 which is obviously different to EPSG:3395. I get the same result in GDAL as ProjNet and ESRI when using 54004. Unfortunately they still aren't as accurate as they can be without the mysterious adjustment that Humminbird does. – adriank Oct 12 '14 at 23:34
1

The conversion code was supplied by peterv6i in this thread.

http://forums.sideimagingsoft.com/index.php?topic=7785.msg48682#msg48682

  public static double MMtoEllipsiodDegLatitude(double Lat_m)
  {
    if (Math.abs(Lat_m) < 15433199.0D)
    {
      if (Lat_m != 0.0D) {
        return Math.atan(Math.tan(Math.atan(Math.exp(Lat_m / 6378388.0D)) * 2.0D - 1.570796326794897D) * 1.0067642927D) * 57.295779513082302D;
      }
      return 0.0D;
    }
    return 0.0D;
  }

  public static double MMtoEllipsiodDegLongitude(double Lon_m)
  {
    if (Math.abs(Lon_m) <= 20038300.0D)
    {
      double d;
      if ((d = Lon_m * 57.295779513082302D / 6378388.0D) > 180.0D) {
        d = 180.0D;
      } else if (d < -180.0D) {
        d = -180.0D;
      }
      return d;
    }
    return 0.0D;
  }
  • 1
    This appears to be a spherical calculation on a sphere of radius 6378388 meters (which is larger than the earth in all directions!) What is the basis for this value? – whuber Feb 10 '15 at 22:20
  • I've no idea but it could be Humminbird trying to make it difficult to decode their recorded coordinates. peterv6i didn't say how he worked it out but apparently he is doing a PhD on sonars so maybe he has some inside knowledge. – adriank Feb 12 '15 at 4:00
  • Possibly the International (1924) datum as in this link uwgb.edu/dutchs/UsefulData/UTMFormulas.HTM. That link and a similar discussion come from bb.sideimageforums.com/viewtopic.php?p=485#p475 – adriank Feb 12 '15 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.