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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
proto
CMakeLists.txt
README.md
gpsproto.cpp
test.pbf

README.md

The gps_trajectory.proto Format

by Chen Chen , Yang Li

Dependency

Google Protocol Buffers

https://developers.google.com/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/gps_trajectory.pb.cc

Compile & run example

In the project root, create a build directory

mkdir build;
cd build;

Call cmake and make

cmake ..;
make;

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.

Notes

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.