[OpenTom] convert address list to POI

Tor Arntsen tor at spacetec.no
Tue Nov 29 17:54:14 CET 2005


On Nov 29, 16:36, Glenn De Moor wrote:
>Hello,
>
>I just found out about the exiting new OpenTom project.
>Very possibly, it'll be able to help me out with an old gripe I have
>with Tomtom products.
>I want to convert a 500+ address to a POI file. Tomtom Support says the
>only way is to enter the addresses manually one-by-one on the device.
>My patience would however (and has) run out long before the end.
>I cannot access the maps directly with GIS-products eventthough the maps
>are StreetNet-based by TeleAtlas. There's some extra coding I don't
>recognize.

I'm not sure I understand the jump from the issue of POI files to maps?
The maps are in a closed, secret format, but POIs are stored separately
in .ov2 files.  The format of .ov2 files isn't exactly advertised but
it's not a secret either and it's even quite simple. (And easy to figure
out by looking at .ov2 files. But you can find the description in some 
document somewhere on the tomtom.com web site, unfortunately I don't 
have a link. Wait, I think it's in the TT3 SDK documentation, which
is available for download, unlike the SDK itself - it's sold separately.
You should find the doc easily in the documentation section though.)

As far as I know every TT device, also GO, uses this format for add-on 
POI files (there's some built-in POI stuff though which is different).

There are even some tools on the tomtom web site for converting to
and from .txt and .ov2 files, for Windows, they run fine as
command line programs with Wine under Linux. But you can easily
make your own tools.

(In other words, if Tomtom Support told you you have to enter one 
and one address on the device they are ignorant about their own web
site, as as far as I know the reference to those ov2tools and how
they can be used to convert a list of POIs in a .txt file to .ov2
is right there in their FAQ somewhere!)

Anyway there are 3 slightly different formats. 'Type 2' is usually 
sufficient. An .ov2 file can have one or more records, if the records
are of type 2 then there's one record per address, and the format of 
each record is as described below:

Byte zero is 2  (this indicates that the record is of "type 2" format)
Next 4 bytes is the size of the (poi) record, in little endian format. 
 It shall include the length of this and the previous and following 
 fields. *)
Next 4 bytes is longitude, little endian int, east-positive, divide by
 100000.0 to get decimal format (e.g. 18.12345E is encoded as 1812345)
Next 4 bytes is ditto for latitude north.
Next follows a null-terminated string with the address (e.g. Gatwick Airport\0)

*)The record size value should cover everything above.

Then just add more records for more POIs.

Here's a _quick-and-dirty_ Perl script to convert ONE position to TT POI
format. You could easily make something from this that can take a list 
as input and produce an .ov2 file full of POIs. The Perl script will
work on a little-endian host, e.g. Intel.

-- cut here --
#!/usr/bin/perl -w
# By Tor Arntsen 2005
# Licensed under GPLv2
use strict;
if ($#ARGV != 2) {
    print STDERR "Usage: $0 lat lon \"the address\"\n";
    print STDERR "lat and lon in decimal format\n"; 
    print STDERR "(e.g. 59.10123 5.24322  which is north and east lat/lon)\n";
    print STDERR "Writes one entry into a file called geotmp.ov2\n";
    exit 1;
}

my $len = 1+length($ARGV[2]); # Include the NULL (added by 'pack')
my $siz = 13+$len; # Size of three first fields plus the string above

# Hardcoded output file.. :-)
open (OV2, "> geotmp.ov2") or die "Could not open geotmp.ov2 $!";

# Pack 1 byte of value 2, one 4-byte unsigned int ($siz),
# two 4-byte signed ints and a \0-terminated string, and
# write the whole lot to the output file:
syswrite (OV2, pack ("C I i i Z$len", 2, $siz,
                    int($ARGV[1]*1E5), int($ARGV[0]*1E5), $ARGV[2]));
close (OV2);
-- cut here --

Then you'll have to provide your own additional .bmp file for
the POI icon, it should have the same name as the .ov2 file but
with .bmp extension instead. The icon should be 22x22x4 bitmap 
format. 
Put the two files into the directory where the map file is.

>Could such a convert-function be coded using OpenTom?
>If so, I'll try to develop this.
>
>A further question: does the device have to be a tomtom? would opentom
>also run on a ipaq 2210. I have a tomtom 300, One and 2 ipaq. one of
>those ipaqs is unused at the moment and could serve as a testing bed.

Presumably you mean ipaqs running Familiar Linux? My guess is 'no'
anyway, as the tomtom linux kernel for tomtom (and thus opentom) is
GO device-specific, but other people on this list are in a much better 
position than me to answer this properly.

>best regards
>glenn

-Tor



More information about the OpenTom mailing list