Preparing Finnish Sea Maps to AFtrack
This note describes how I prepared Finnish sea maps to AFtrack
BSB/KAP-format. The source maps are delivered in ECW format with TAB
header. The maps are copyrighted material and not delivered for free.
The workstation is Ubuntu Linux 10.04 LTS and the AFtrack is installed to Google Nexus 7 (Android 4.2).
The process is similar to preparing Finnish NLS maps to AFtrack.
Please have a quick look to it before continuing. This note explains
how to deal with the ECW files and presents the Perl script that
automates the process.
ECW to TIFFThe first phase of the process is to transfer ECW file
to TIFF format. This is tricky as ECW library is not freely distributed
and you have to find and compile it yourself. The latest versions have
been offered by ERDAS (libecwj2) in their web site but currently the
file has been removed. Luckily the older version (3.3) is distributed
in a number of sites. It can be used with GPL in GPL software.
The other software needed in transfer is GDAL and its transfer utility gdal_translate. GDAL is free software but typical binaries do not support libecwj2.
libecwj2 can be installed by following instructions at OpenStreetMap WIKI. Here is the beef:
The files can also be found at this site.
patch -p0 < libecwj2-3.3-msvc90-fixes.patch
patch -p0 < ../libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch
The build is straightforward:
sudo make install
Ubuntu/Debian has GDAL package. Unfortunately it does not support the libecwj2. Instead of compiling GDAL I used the UbuntuGIS PPA:
- Add "https://launchpad.net/~ubuntugis/+archive/ppa/" to your repos.
- sudo apt-get install libgdal-ecw-src
- sudo gdal-ecw-build /usr/local/
Once you have the ability to read ECW files the rest is easy. The attached script nls_to_bsbkap.pl makes the conversion for all files in a directory.
Before using you have to install some tools.
- Image::Resize - Ubuntu has this packaged, install by
sudo apt-get install libimage-size-perl
- Geo::Coordinates::ETRSTM35FIN - Unfortunately this module does not have Ubuntu/Debian package. To install the module you have two options:
- If you have root privileges you can install the module system-wide.
- It is possible to install the module under your home directory.
However, a more straightforward method is to grab the source package (Geo-Coordinates-ETRSTM35FIN-x.y.tar.gz)
and place the containing folder
Geo-Coordinates-ETRSTM35FIN-0.01/lib/Geo and its contents to a
directory where you later execute nls_to_bsbkap.pl.
Updated 19-NOV-2011 / Matti Lattu