View Single Post
Posts: 13 | Thanked: 3 times | Joined on Aug 2008
#8
okay so I wrote a perl script that will take downloaded BSB files from the NOAA RNC repository and scale/rotate/cut the charts into well placed slippy map tiles at 6 zoom levels. So let's say you download chart 13228. Running the script will produce a directory named 13228, that has subdirectories named for those 6 zoom levels (say .. 14,13,12,11,10,9) and subdirectories contained therein for columns of tiles and then all the appropriate tile images.

I downloaded all of the charts for Massachusetts and Rhode Island and was able to batch process them in 6 hours. This will produce one maemo-mapper style repository per chart (since these charts can overlap and there's no automatic way to know which chart a user wants to see since some are overviews and others are harbor detail maps -- there are things we can do to fix this, but since all charts say which number to look at for the adjacent chart, it shouldn't be that hard to switch repositories manually). It would be nice if there was a way to copy all of the repositories to your N8x0 so that you don't have to be connected to the internet while on your boat.

This script may only work for stuff in the western half of the northern hemisphere.

Steps to get a NOAA chart into maemo map:
1.) Download/install the latest version of ImageMagick so that the 'convert' binary is in your search path
2.) Download libbsb so that the 'bsb2png' binary is in your search path
3.) Make sure you have perl installed. If it's not installed at /usr/bin/perl, you'll need to call the perl script with $PERL_HOME/perl ./generateOSMTiles.pl
4.) Download the generateOSMTiles.pl.txt script attached here (and rename it to generateOSMTiles.pl .. I had to add the txt ending so that I could attach it)
5.) Download a RNC chart from NOAA (google search for NOAA RNC charts) and unzip them to a folder somewhere (let's say you extract the zip file to a directory $RNC_HOME...)
6.) Assuming that you downloaded chart 13228, then run generateOSMTiles.pl with the command:

Code:
$ generateOSMTiles.pl $RNC_HOME/BSB_ROOT/13228/13228.KAP
7.) Get access to a webserver, and upload the entire directory whose name is the chart number (assume here you uploaded to www.myweb.com/13228
8.) Launch maemo mapper on your nokia, add a new repository (by going to the menu, then maps > manage repositories and clicking New...), give it a name like "NOAA 13228". Change the URL Format to http://www.myweb.com/13228/%d/%d/%d.png. I used the default parameters for the rest of the options.

--Rob
Attached Files
File Type: txt generateOSMTiles.pl.txt (14.2 KB, 244 views)

Last edited by robgfx; 2008-08-22 at 17:02.
 

The Following 2 Users Say Thank You to robgfx For This Useful Post: