Skip to content

freezingDaniel/vantrue-gps-dat-parser

Repository files navigation

vantrue-gps-dat-parser

Parse the yyyymmdd.dat files of a Vantrue N4 Pro and create an HTML view of the GPS track.

Example Nürburgring

File format

The .dat file appears to use this format:

YYYYMMDDHHMMSS,latitude,N,longitude,E,speed_in_knots,altitude_in_meters

The last two values took me quite some time to figure out, so I wanted to share that here in case that is all you were looking for.

What it does

  • Reads one .dat file or a directory of .dat files
  • Parses GPS timestamps and coordinates
  • Converts speed from knots to km/h
  • Generates an interactive HTML map with:
    • speed-colored track segments
    • markers for segment start/end
    • waypoints
    • a time slider to inspect the track step by step
    • total distance display

Usage

Run the parser on a file or directory:

python gps_data_parser.py /path/to/gps/files

If no path is provided, the script uses the default GPS directory configured in the code.

To overwrite existing HTML output files:

python gps_data_parser.py /path/to/gps/files --overwrite

Output

For each input file, the script creates an HTML file next to it with the suffix:

_map.html

Example:

20240101.dat -> 20240101_map.html

Requirements

Install the Python dependencies listed in requirements.txt.

Track sampling and movement filtering

Two constants control how the track is simplified before it is drawn:

  • DISPLAY_STEP = 10
    Keeps only every 10th GPS point for display (every 10 seconds). This was chosen to allow smooth rendering even for the maximum 24-hour tracking data generated by the dashcam, while still preserving the overall shape of the route.

  • MIN_MOVEMENT_KM = 0.1
    Ignores movement smaller than 0.1 km when computing distance. This helps suppress GPS noise when the car is stationary or barely moving, so the reported distance is closer to the actual driven distance.

Notes

  • The parser is tailored to Vantrue N4 Pro GPS .dat files.
  • Latitude/longitude direction fields are respected for N/S and E/W.
  • Speed values are shown in both knots and km/h.
  • Altitude is displayed in meters.

Vibecoded, use at your own risk

I use it and haven't had any issues so far; your mileage (pun intended) may vary.

About

Parse the yyyymmdd.dat files of a Vantrue N4 Pro and create an HTML view of the GPS track.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors