To see as much of the world as we can,
Using the smallest carbon footprint we can,
Spending the least amount of money we can,
Making as many friends we can.

Team Red Cruising

Finding a Single Source of Truth

We have a primary chart plotter on Red Ranger. And we have backups. A lot of backups. A second chart plotter, an iPad, a MacBook pro. I even have iNavX on my phone, so it can work under limited circumstances. (I don't have all of the US East Coast charts on my phone, for example, so it's not great.)

Each device has its own limitations on what names are allowed. Each device has its own internal state. And the states diverge as soon as you create or edit a waypoint.

This situation closely reflects the two hardest problems in computing:

  • Naming things.

  • Invalidating cache to manage distributed state.

  • Off by one errors.

I have a problem, which — I acknowledge — is not simple. I need a workable approach to reduce entropy in this system I've created. I need to manage a distributed state.

To make it more painful, I still don't have current charts in the first place. So I really have two problems. One is relatively minor, but exasperating.

Here's the side-bar story.

Downloading charts for the chart plotter is a right pain in the ass. I'm sure there's a way to do it, but I haven't figured it out. The problem I have is that C-Map doesn't support Macintosh computers.

The C-Map folks need to confirm I have a paid-for SD card. And they want to confirm this via a Windows computer and their Windows-only app that checks the SD card. (It's 2020, a WASM or Rust app that runs everywhere would be nice. Better, a frozen Python app, like Dropbox, that runs everywhere would be even nicer. C-Map could partner with Dropbox to keep our charts up-to-date on our computer.)

Sigh.

I ordered SD cards from places like The GPS Store. And either I messed up the order or they did, but I got an SD card that the Zeus2 chartplotter can't use.

Big Sigh.

Ultimately, the data comes from C-Map. The GPS Store is a retailer and doesn't really know very much about the supported devices. For them, the messed-up order is a technical problem ("Call C-Map, they're super-helpful.") I don't think it's a technical problem; it's a "you shipped the wrong format" problem (or, I ordered the wrong format.) I'm happy to send the SD card back. But. They didn't seem to have a clear procedure for what to do other than place yet another order for charts.

First Lesson Learned

Order from C-Map directly. Place separate orders for separate chart plotters. Do Not Combine Two Orders For Two Separate Devices. Skip the retailer, they're unhelpful.

But it doesn't stop there; that's only the first of my two problems.

5DBCE075-870D-4372-8191-051649DF539E
5DBCE075-870D-4372-8191-051649DF539E ""

I use a computer for planning, separate from the chartplotter that handles navigation. This means I have two copies of waypoints and routes. This leads to a distributed state with multiple local caches. One of the two hardest problems in computing.

It's not like the computer or the plotter is definitely authoritative. The chart plotter's subset of waypoints is very useful, since it reflects actual on-the-water observations and changes. The computer, however, has the whole history of Red Ranger. Including all of the previous owners waypoints from their ancient charting system. (It also has five waypoints with the name "OK". Why did I do that?)

I have the seed (https://github.com/slott56/navtools) for an app that can compare the sets of waypoints.

  • By Name. A few waypoints (6 out of ~630 total) are clear copies from one device to the other. The names and locations match. (A few have modified locations in spite of the name match, which is right?)

  • By Location. A few waypoints (9, actually) look like copies with modified names. This may mean I entered them manually. Which strikes me as dumb, but, for a while I didn't have a direct computer-to-chartplotter connection.

So. I have software tools to confirm the level of chaos. What do I do?

Lesson Two

I need a procedure for resolving the two sets of waypoints (and routes, knowing routes depend on waypoints.) This means make one of the two sources the final authority, and the other device has copies of the waypoints and routes.

I think it's this:

  1. Copy the distinct, unique chartplotter waypoints to the computer, making the computer the one source of truth. It doesn't seem to be easy to filter on the chartplotter, so I need my comparison app to also have a fancy set of filters to locate "unique" according to some flexible criteria.

  2. Manually tinker with "near-miss" waypoints which reflect edits and get the waypoints and routes cleaned up and (if possible) deduplicated.

  3. Copy all of the routes from the chartplotter and reconcile those with the computer routes. Again, my comparison app will need to filter the chartplotter routes to avoid creating obvious duplicates. Much manual adjustment is required. There will be "to-be deleted" waypoints, I think, that are still part of a route, but need to be replaced as part of waypoint deduplication.

  4. Once it's clean on the computer, I can then replace the routes on the chartplotter wholesale. Incremental changes aren't part of it.

It seems reasonably simple, right?

I'm not sure what this process will do to any modified waypoints. Will I have duplicates? The chartplotter assigns a GUID to each waypoint, to spot name changes. BUT. These are not obviously present in the chartplotter's GPX files, so I suspect I'll have duplicates. The schema allows for extensions (see https://www.topografix.com/GPX/1/1/#type_extensionsType) and OpenCPN seems to use its own extension schema.

The confounding factor? We're leaving Red Ranger for three months. So. No chance to fuss around directly with the chartplotter or the charts. I can merge stuff into OpenCPN, but, I can't check my results on Red Ranger.