Results 1 to 5 of 5

Thread: How to Generate OV2 Files for POI records

  1. #1
    Join Date
    Feb 2009
    Posts
    45

    question How to Generate OV2 Files for POI records

    Hello,

    I've neve done BinaryWriting, but i need to generate TomTom and Destinator files from a POI database.

    I manage to get this specification over the internet, but i'm having troubles to generate the file an OV2 file consists of POI records.

    please suggest how to generate the OV2 files for POI records.

    Any suggestion would be appreciated.

  2. #2
    Join Date
    Apr 2008
    Posts
    193

    Re: How to Generate OV2 Files for POI records

    Just for reference, i found this php code that seems to do the job,

    $csv=file("File.csv");
    $nbcsv=count($csv);
    $file="POI.ov2";
    $fp = fopen($file, "w");
    for ($i = 0; $i < $nbcsv; $i++) {
    $table = split(",",chop($csv[$i])); // Every ligne in this type:
    longitude,latitude,description
    $lon = $table[0];
    $lat = $table[1];
    $des = $table[2];
    $TT = chr(0x02).pack("V",strlen($des)+14).pack("V",round
    ($lon*100000)).pack("V",round($lat*100000)).$des.chr(0x00);
    @fwrite ($fp, "$TT");
    }
    fclose($fp);

  3. #3
    Join Date
    Feb 2009
    Posts
    45

    create a file in tomtom OV2 format

    Can anyone provide me some code for file in tomtom OV2 format.
    I know that each entry must use the some sort of data but I'm not getting very far trying to use BitConverter.

    Can anyone provide any assistance?

  4. #4
    Join Date
    Mar 2008
    Posts
    227

    Re: How to Generate OV2 Files for POI records

    Here i will provide you some kind of structure for the OV2 files found over the Internet which is to the extent right.

    int length = name.Length + 14;
    byte[] ov2Data = new byte[length];
    byte[] buffer = BitConverter.GetBytes('2');
    //ov2Data[0] = buffer[0];
    ov2Data[0] = 2;
    buffer = BitConverter.GetBytes((long)length);
    Array.Copy(buffer, 0, ov2Data, 1, 4);
    buffer = BitConverter.GetBytes((long)(position.Longitude * 100000));
    Array.Copy(buffer, 0, ov2Data, 5, 4);
    buffer = BitConverter.GetBytes((long)(position.Latitude) * 100000);
    Array.Copy(buffer, 0, ov2Data, 9, 4);
    System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
    buffer = encoding.GetBytes(cache.Name);
    Array.Copy(buffer, 0, ov2Data, 13, name.Length);
    ov2File.Write(ov2Data);

  5. #5
    Join Date
    Feb 2010
    Posts
    1

    Re: How to Generate OV2 Files for POI records

    does anyone know how to do this with GPI files for garmin ??

    I have done this with OV2 for TomTom, but our company also uses garmin units.

    cheers

Similar Threads

  1. Can we generate exe file in php?
    By amitweb007 in forum Software Development
    Replies: 1
    Last Post: 26-09-2011, 11:38 AM
  2. How to generate XML data
    By Lawford in forum Software Development
    Replies: 5
    Last Post: 23-02-2010, 04:34 AM
  3. How to use the generate() in CPP
    By Gaelic in forum Software Development
    Replies: 5
    Last Post: 15-02-2010, 10:08 PM
  4. How to generate trans.log in SAP
    By Naresh Modi in forum Software Development
    Replies: 3
    Last Post: 14-08-2009, 10:03 AM
  5. How to generate a CSR for Apache 2.x
    By Bency in forum Tips & Tweaks
    Replies: 0
    Last Post: 21-06-2008, 12:54 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,287,075.25786 seconds with 17 queries