Skip to content
Template for reading and writing pbf trajectory files
C++ CMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

The gps_trajectory.proto Format

by Chen Chen , Yang Li


Google Protocol Buffers

Compile protobuf class

Go to proto/, compile the format file gps_trajectory.proto

protoc -I=. --cpp_out=. gps_trajectory.proto

This will generate proto/gps_trajectory.pb.h and proto/

Compile & run example

In the project root, create a build directory

mkdir build;
cd build;

Call cmake and make

cmake ..;

Inside build/, call gpsproto on a test trajectory file:

./gpsproto ../test.pbf test_out.pbf

test.pbf and test_out.pbf should be the same.


Each GPS sample can be annotated with the following attributes:

  • int32 car_id: car/driver id
  • uint32 timestamp: linux time stamp of sample
  • int32 lon: longitude x 10^5
  • int32 lat: latitude x 10^5
  • int32 head: heading angle in degrees
  • int32 speed: speed in meter/second
  • float x: easting in meters (e.g UTM coordinates)
  • float y; northing in meters (e.g UTM coordinates)
You can’t perform that action at this time.