Archive.fsh Files Reverse Engineered

sailing_doEverybody with a handheld GPS device or a smart phone may contribute to the map of OpenStreetmap. In contrast, to contribute to OpenSeamap — which is the OSM-based sea chart variant — it requires to measure the depth of sea. Of course, a sea map contains a lot of features which can still be mapped in the “traditional method” such as seamarks, bridges, rocks, wrecks, piers, anchorages,… but not the depth.

Safe navigation of boats requires a precise knowledge about the sea bed and the coastline.1 Thus, all modern vessels are equipped with accurate navigation systems, depth loggers, sea charts, and other important features (GPS, charts, chart plotters,…).

Depth Data

OSM does not provide any information about the depth of the sea, rivers, and lakes. Although there is the GEBCO data publicly available, it is not of much use to boat navigation. These depths are just valid below 50 meters and this is safe for even the biggest vessels on Earth.

There are several projects dealing with depth measurement and building of databases. The difficulty actually is the measurement itself and not the database. Sea level is not something fixed — there are tides, waves, currents.

Several guys around the OpenSeamap project are trying to build small hardware devices which should be attached to the on-board device bus2 of a boat. They should simply log GPS coordinates and depth information to an SD card. At least for an ordinary person, attaching such a device to the right connectors or screw terminals could be tricky or even impossible.

Thus I decided to go a different way. Modern chart plotters are able to log tracks themselves onto SD cards, such as the Raymarine plotters. Unfortunately, they use a proprietary binary format and one shall buy their software to read the files.

The Joy Over Proprietary Formats

hexeditAs far as I could find out there is the GPS Utility which can read the files. Although there is a Freeware version available, it is a closed source software. Furthermore, there is just a Windows version available which makes it useless for me and for server-side batch processing.

Then there is an open source Python script which was developed several months ago. It is able to read ARCHIVE.FSH files at least in parts. The author (Scott Emmons) did a good job in reverse engineering the basic file structure.

Based on this I was able to parse the basic structure and from that I could derive more information about the internals. Currently, we know two different types of information: routes and tracks. Routes are a list of waypoints. A waypoint is an object with coordinates and a name and some other not yet discovered information. A track is a list of track points and these in turn are objects with coordinates but are not named as waypoints. Track points contain also the water depth and also some unknown data.

It is interesting that waypoints contain the coordinates in two different formats. First, directly as geographic latitude and longitude multiplied by 1E7 and second as projected ellipsoid Mercator coordinates where the latitude is additionally multiplied approx. by the factor 107. The reference ellipsoid seems to be WGS84 since the results are very accurate. Furthermore I wonder if the depth is also found in waypoints but I didn’t have enough test data yet. A further interesting aspect is that I could not find any timing information yet although I am rather sure that time must be somewhere.

Software And Documentation

I wrote a parser simply called parsefsh3 which can be downloaded here. It’s released and GPL. A detailed information about the structure is found in the OSM Wiki4 and also in the header file fshfunc.h. Feel free to send me ARCHIVE.FSH files and of course be invited to find out more about the missing fields. Parsefsh will display a values. Of course, you can modify it up to your needs.

I contacted the guys from gpsbabel and OpenCPN. Probably the would like to add this to their software. Unfortunately, I got no response yet. Although I do not make other projects look bad, in the case of OpenCPN I have to say that it was difficult to find any contact information even though it is an Open source project as well — no mailing list, no dev’s email address. Just a web forum which typically is something for end users but not developers ­čśë

Have fun in reverse-engineering more information about the file structure!

  1. Of course, there is a lot of other stuff but this is not important within this context.
  2. Such as NMEA or Seatalk.