Friday, June 3, 2011

The Charts, or, Here Be Dragons

 The success of any passage relies crucially on nautical charts. You need detailed charts to point out the shallows, submerged rocks, unexploded ordinance, off-limit areas, lighthouse flash patterns, port locations and the like.

A typical nautical chart, showing anchorages and sea depth
Whoever makes charts that show the best bars will make a killing
You might expect that, given where we are (post dotcom bubble, 5 decades after Sputnik, 498 years after Piri Reis's legendary map that spans both the Mediterranean and the New World), one could find excellent nautical charts just for the asking. You'd be wrong. There are no free charts of the Old World. Ironically, only NOAA has had the foresight to make all of its electronic charts available for free, but these only cover US shores.

How hard could it be to have depth-annotated electronic charts, with every object of interest clearly-described in some portable, open-source format? If you need to make it klunky (and the people who are in the business of cataloging objects love klunky things), you could use XML. If you wanted it to be moderately useful, you'd create something with hyperlinks to nearby objects of interest in Wikipedia. If you wanted it to be cool and awesome, you could make an online Hitchhiker's Guide to the Med, with pointers to fun stuff to do along the way, recommendations for entertainment and past trip reports. I understand why a giant company whose motto is to catalog all the world's information, and I'm looking at you Google, would prefer to spend its effort on collecting information on people's browsing habits so it can show them little text ads. And somehow all of its competitors seem intent on doing a worse job at the same task. But why can't the European governments just make their shoreline information available for free? Something about free information just rubs Europeans the wrong way. Their governments actually create very accurate charts, but give it to a handful of monopolistic companies, which then charge monopoly prices for access to a public good. So information always comes at a price in Europe, even though free charts might avoid a few rescues every year and cut down on coast guard expenses.

The sad reality is that old-school nautical charts are fairly expensive: they cost about 20-30 euro per chart. I'll cross around 2200 miles through 6 countries, so the number of charts I might need turns out to be somewhere around 200. That cost comes out to a staggering $10K or so. I'm sure there are relatively cheaper alternatives, such as buying a new chart plotter and subscribing to UK Admiralty charts, but they still cost beyond what I was mentally prepared to pay, namely $0, so I didn't explore them.

Instead, I found a website that allows the public to view a portion of their charts online prior to purchase. Essentially, they give you a tiny window that you can move around on the chart so you can examine little details and decide if the chart is worth buying. The window is really small, around 200 by 200 pixels, and the charts are really big, so they figure that if you really need to use the chart, you'll go ahead and buy it. I carefully read their terms of service and noticed that they did not limit what one could do with the portions of the charts that were freely viewable prior to purchase. So I wrote a computer program to automatically move the tiny window and capture the results over all the charts they had for sale. Over 4 days, this yielded 107814 tiny captured images. I then wrote another program to stitch these back together into 389 charts, which took another day to run.

That left me with 389 chart-containing images, but to be usable in a navigation program (I use OpenCPN on a Linux laptop), I needed more than pretty pictures. The images need to be anchored to their actual boundaries on the real world. So, over the course of three cold winter nights, I cropped the extra pixels around each chart image by hand, and jotted down the upper left and lower right coordinates of every chart. I then wrote a program to take the images and their coordinates, and generated KAP files suitable for use in OpenCPN.

I think the end result is a huge success. There are only three problems:


First, some of the nautical charts I plan to use for navigational purposes bear this warning. I personally think it's a nice feature. The warning is usually written in a corner of the chart, usually on land, so it does not interfere with my usage of the charts at all. And it scares away people who're peering over my shoulder. If you like doing your route planning in peace, this is great.

Soviet sub buzzing a beach
It takes large cojones and good charts to pull this off
Second, the source data seems to come from Soviet submarine charts. This has made some friends, all Americans, question the accuracy of my charts. Frankly, I think they're full of it and the Red Navy knew what it was doing, notwithstanding a couple of embarrassing incidents where Soviet subs ended up beached on various shores (due, no doubt, to errant rocks placed in inappropriate locations by the Bourgeoisie).
Soviet sub S-363 Whiskey, aka "Whiskey on the rocks," off of Stockholm

Soviet sub up a river. It's cool when salmon do this.
Finally, the chart data seems to have been collected in the 1954-1974 time frame. How much could the sea floor have changed in 30-50 years? I actually have no idea, but I'm hoping and betting that the answer is "not much." Some of the charts seem to have been updated in the 90's, so that's, like, another free bonus.



5 comments:

Timothy Weber said...

I laughed SO hard reading about your clever hack! Your storytelling is enjoyable as always, but this one was particularly hilarious.

Anonymous said...

almost as cheap as your hack, assuming you can steal an ipad from somewhere:

http://itunes.apple.com/us/app/marine-europe-hd/id409794756?mt=8

maybe they can come up with a hitchhikers guide to sailing europe.

Anonymous said...

My miser crown is no match for your energy, code savy and wit.

Take it, it's yours.

Gladly,

Ill Wind

egs said...

@Ill Wind: Thank you for the very nice comments. You should totally get a mini yourself and join me in the Med. There's plenty of space here and clearly we'd have a great time.

Unknown said...

I am author and editor www.1yachtua.com. Also I draw all charts from my site.
I want to close possibility for previous viewing of proposed charts - this small wind 200x200.
Who will lose more? I'm sorry, but I need to pay for food - I did not steal it on the Internet