View previous topic :: View next topic |
Author |
Message |
babybob Occasional Visitor
Joined: Nov 27, 2004 Posts: 33 Location: uk
|
Posted: Sun Nov 28, 2004 12:10 am Post subject: Help With POI OV2 Format |
|
|
Hello
I am looking at starting a freeware addon for tomtom mobile and it involves creating custom OV2 databases from lists of lat/long locations.
I can see that tomtom provide and convertor from txt to OV2, and that there are plenty of other converters around, however non of these are going to work on a windows smartphone.
Could someone point me in the right direction for creating my own txt -> OV2 convertor? I can't find anything about the format used in OV2.
Thanks for any help
Brian
www.bbpsoftware.co.uk |
|
Back to top |
|
|
lbendlin Pocket GPS Staff
Joined: 02/11/2002 22:41:59 Posts: 11878 Location: Massachusetts, USA
|
Posted: Sun Nov 28, 2004 1:06 am Post subject: Re: Help With POI OV2 Format |
|
|
babybob wrote: | however non of these are going to work on a windows smartphone |
Why not? It's the same ARM processor as the Pocket PC, so all non GUI programs work equally well on both machines. And if the GUI is programmed dynamically then even the GUI programs can be swapped. (For the fun of it, try to run TomTom Mobile on the Pocket PC, and you see what I mean)
The OV2 format is described in the SDK documentation which can be downloaded from the TomTom site. _________________ Lutz
Report Map Errors here:
TomTom/TeleAtlas NAVTEQ |
|
Back to top |
|
|
babybob Occasional Visitor
Joined: Nov 27, 2004 Posts: 33 Location: uk
|
Posted: Sun Nov 28, 2004 8:54 am Post subject: |
|
|
Hello
Thanks for the reply. So is there already a convertor that will work on an ARM processor?
Also I could not find the sdk mentioned anywhere on the tomtom site?
Thanks
Brian |
|
Back to top |
|
|
lbendlin Pocket GPS Staff
Joined: 02/11/2002 22:41:59 Posts: 11878 Location: Massachusetts, USA
|
|
Back to top |
|
|
babybob Occasional Visitor
Joined: Nov 27, 2004 Posts: 33 Location: uk
|
Posted: Sun Nov 28, 2004 5:03 pm Post subject: Bit of help with binary file format |
|
|
Thanks for your help so far. Ive found the tomtom sdk documentation but am struggling to convert the long/lat into binary. When I try I dont get the right hex values (checked by converting some of the speedcam files using my test convertor)
The tomtom doc says:
Quote: | Coordinates are stored as 4−byte integers representing a WGS84 longitude or latitude, multiplied by
100.000 and rounded to the nearest integer. As such, an X−coordinate should always be a value between
−18.000.000 and +18.000.000, and a Y−coordinate should be a value between −9.000.000 and +9.000.000. |
so I tried:
-4.21648 * 100
then rounded the result to the nearest integer:
= -422
However if I then write it to a binary file I get these bytes:
5A FE FF FF
The example OV2 file i got the original lat long from however has:
F1 90 F9 FF
Maybe Im being really dumb, as Im not used to working with binary files. Could someone give me a full example.
Thanks
Brian Norman[/b] |
|
Back to top |
|
|
lbendlin Pocket GPS Staff
Joined: 02/11/2002 22:41:59 Posts: 11878 Location: Massachusetts, USA
|
Posted: Sun Nov 28, 2004 6:41 pm Post subject: |
|
|
you need to multiply by 100000 , not just by 100 _________________ Lutz
Report Map Errors here:
TomTom/TeleAtlas NAVTEQ |
|
Back to top |
|
|
babybob Occasional Visitor
Joined: Nov 27, 2004 Posts: 33 Location: uk
|
Posted: Sun Nov 28, 2004 7:07 pm Post subject: oops |
|
|
yes I forgot that 100.00 was not in uk format. I thought it was a decimal, but tomtom would mean the . as a , in uk format.
Thanks!
Brian |
|
Back to top |
|
|
lbendlin Pocket GPS Staff
Joined: 02/11/2002 22:41:59 Posts: 11878 Location: Massachusetts, USA
|
Posted: Sun Nov 28, 2004 7:17 pm Post subject: |
|
|
UK format? 100.00 ?
Anyhow, the period is a group separator, not the decimal delimiter. _________________ Lutz
Report Map Errors here:
TomTom/TeleAtlas NAVTEQ |
|
Back to top |
|
|
babybob Occasional Visitor
Joined: Nov 27, 2004 Posts: 33 Location: uk
|
Posted: Sun Nov 28, 2004 9:33 pm Post subject: Still not getting it right |
|
|
Sorry to be a pain, but this is still not quite right.
I am using this:
-4.21648,50.41288,"SPECS:1A@30"
Which when converted by WinOV2 gives:
02 19 00 00 00 F1 90 F9 FF 87 EC 4C 00 53 50 45 43 53 3A 31 41 40 33 30
00
But my code gives:
02 19 00 00 00 F0 90 F9 FF 88 EC 4C 00 0B 53 50 45 43 53 3A 31 41 40 33
30 00
The code im doing in c# is al follows:
Code: | private void writeOVP()
{
BinaryWriter bw = new BinaryWriter(File.Create(@"C:\temp\Brian.ov2"));
byte bType = 2;
byte bTerminator = 0;
int iBaseLength = 14;
decimal dLong = -4.21648M;
decimal dLat = 50.41288M;
int iLong = Convert.ToInt32(Math.Round(dLong * 100000,0));
int iLat = Convert.ToInt32(Math.Round(dLat * 100000,0));
string sLocationDesc = "SPECS:1A@30";
int iLength = iBaseLength + sLocationDesc.Length;
bw.Write(bType);
bw.Write(iLength);
bw.Write(iLong);
bw.Write(iLat);
bw.Write(sLocationDesc);
bw.Write(bTerminator);
bw.Close();
} |
I thought it might be how the rounding was done, but there should be no rounding as the lat/long * 100.00 is an integer anyway?
Any ideas appreciated
Thanks
Brian |
|
Back to top |
|
|
lbendlin Pocket GPS Staff
Joined: 02/11/2002 22:41:59 Posts: 11878 Location: Massachusetts, USA
|
Posted: Sun Nov 28, 2004 9:46 pm Post subject: |
|
|
There are some small rounding differences, but they are negligible. 0xF0 instead of 0xF1, for example.
Your problem is the extra 0x0B - what's that supposed to do? Is it possible that
bw.Write(sLocationDesc);
writes not just the string but also the string length? _________________ Lutz
Report Map Errors here:
TomTom/TeleAtlas NAVTEQ |
|
Back to top |
|
|
babybob Occasional Visitor
Joined: Nov 27, 2004 Posts: 33 Location: uk
|
Posted: Mon Nov 29, 2004 8:20 am Post subject: |
|
|
yes you were right, the binarywrite method for a string prefixes the string with its length. Thanks yet again, now maybe I can get on with the rest of the project!
Brian |
|
Back to top |
|
|
|
Posted: Today Post subject: Pocket GPS Advertising |
|
|
We see you’re using an ad-blocker. We’re fine with that and won’t stop you visiting the site.
Have you considered making a donation towards website running costs?. Or you could disable your ad-blocker for this site. We think you’ll find our adverts are not overbearing!
|
|
Back to top |
|
|
|