Package: tracktotrip3
TrackToTrip3TrackToTrip3is a Python 3 adaptation of theTrackToTriplibrary used to process GPS tracks.The main goals are to transform a (gpx)track into a trip.trackraw representation of a GPS recording. It is not precise, has noise and valuable information is hidden.tripresult of one or more processed tracks. Its start and end points have semantic meaning, such as home, work or school. It has less errors and it's compressed, with as little information loss as possible. In short, a trip is an approximation of the true path recorded.InstallingYou can install TrackToTrip3 by running the following command:$ python setup.py installNOTE:TrackToTrip3 requires Microsoft Visual C++ 14.0. It can be found using theBuild Tools for Visual Studio 2022Python 3.xis required.OverviewThe starting points are theTrack,SegmentandPointclasses.TrackCan be loaded from a GPX file:fromtracktotrip3importTrack,Segment,Pointtrack=Track.from_gpx('file_to_track.gpx')A track can be transformed into a trip with the methodto_trip. Transforming a track into a trip executes the following steps:Smooths the segments, using thekalman filterSpatiotemporal segmentation for each segment, using theDBSCAN algorithmto find spatiotemporal clustersCompresses every segment, usingspatiotemporal-aware compression algorithmA track is composed bySegments, and each segment byPoints.It can be saved to a GPX file:withopen('file.gpx','w')asf:f.write(track.to_gpx())SegmentA Segment holds the points, the transportation modes used, and the start and end semantic locations.PointA Point holds the position and time. Currently the library doesn't support elevation.Command line toolsIn addition to the library,TrackToTrip3offers three command line tools outside of the library to manipulate GPS tracks and to generate classifier.tracktotrip_utilsusage: tracktotrip_utils.py [-h] [-a] [-s] [-o] [--eps EPS]
                            [--mintime MINTIME] [--seed SEED]
                            track [track ...] output_folder

Manipulate tracks

positional arguments:
  track              track to process, must be a gpx file
  output_folder

optional arguments:
  -h, --help         show this help message and exit
  -a, --anonymize    anonymizes tracks, by doing random rotations and
                     translations
  -s, --split        splits tracks so that each file contains a segment
  -o, --organize     takes all tracks and split them, naming them according
                     with their start date
  --eps EPS          max distance to other points. Used when spliting.
                     Defaults to 1.0
  --mintime MINTIME  minimum time required to split, in seconds. Defaults to
                     120
  --seed SEED        random number generator seed. Used when anonymizingtracktotrip_geolife_datasetTheGeoLife Tracjectory datasetcan be foundhere. The datasetFolder argument should point to the Data folder in theGeoLife Trajectory datasetfolder.usage: tracktotrip_geolife_dataset.py [-h] [-o outputFolder] [-d]
                                      datasetFolder

GeoLife Trajectory dataset transportation mode extractor. Extracts
transportation mode from the dataset, into individual files, annotated with
the following format: [transporation mode].[control].[nPoints].[original file
name].gpx



positional arguments:
  datasetFolder         Path to the GeoLife dataset folder

optional arguments:
  -h, --help            show this help message and exit
  -o outputFolder, --output outputFolder
                        Path to processed datasetLicenseMIT license