Giter VIP home page Giter VIP logo

tptk's Introduction

TPTK - Trajectory Preprocessing Toolkit

TPTK is a trajectory preprocessing toolkit in Python.

Note that, this is only my personal implementation. For the industrial level quality and efficiency, you're welcome to try our product JUST.

Currently, TPTK serves as a basic library of DeepMG.

Features

  • Data Structures

    • SPoint
      • The fundamental spatial point class
    • MBR
      • Minimum bounding box
    • Trajectory
      • A sequence of time-ordered spatio-temporal points
    • Directed & Undirected Road Network
      • A custom class with routing and spatial query support
      • I/O with OpenStreetMap data (Please refer to osm2rn)
  • Basic Spatial Functions

    • Distance Calculation
      • Haversine distance
    • Spatial Griding
      • Split a given mbr into specified size/interval grid cells
    • Line Segment Simplification
      • Douglas-Peucker algorithm
  • Data Manipulation

    • Spatial Query (TODO: indexing)
    • Spatio-temporal Query (TODO: indexing)
  • Trajectory Preprocessing Algorithms

    • Noise Filtering

      • Spatio-temporal Range Filter
      • Heuristic Filter
    • Segmentation

      • Time Interval-based Segmentation
      • Stay Point-based Segmentation
    • Stay Point Detection

      • Classical Stay Point Detection
      • Density-based Stay Point Detection
    • Map Matching

      • Algorithms
        • Hidden Markov Map Matching
      • Output Formats
        • Matched GPS point list match
        • Matched path match_to_path
  • Trajectory Statistics

    • Summary: #objects, #points, #trajectories
    • Distribution: #points, time interval, distance interval, length, duration

Datasets

  • Trajectory Data

    • There are some open-source trajectory datasets, e.g., TDrive.
  • Road Network Data

Usage

  • Clean Trajectories
python main.py --phase clean --tdrive_root_dir ./data/taxi_log_2008_by_id/ --clean_traj_dir ./data/tdrive_clean/ 
  • Map-match Trajectories
python main.py --phase mm --clean_traj_dir ./data/tdrive_clean/ --rn_path ./data/Beijing-16X16-latest/ --mm_traj_dir ./data/tdrive_mm/
  • Trajectory Statistics
python main.py --phase stat --clean_traj_dir ./data/tdrive_clean/

Papers

If you find our code useful for your research, please cite our papers:

Sijie Ruan, Ruiyuan Li, Jie Bao, Tianfu He, Yu Zheng. "CloudTP: A Cloud-based Flexible Trajectory Preprocessing Framework". ICDE 2018.

Sijie Ruan, Cheng Long, Jie Bao, Chunyang Li, Zisheng Yu, Ruiyuan Li, Yuxuan Liang, Tianfu He, Yu Zheng. "Learning to Generate Maps from Trajectories". AAAI 2020.

Requirements

TPTK uses the following dependencies with Python 3.6

  • rtree==0.8.3
  • networkx==2.3
  • GDAL==2.3.2

Other packages can be easily installed using conda install, while the following scripts are recommended for gdal.

conda install -c conda-forge gdal==2.3.2

tptk's People

Contributors

sjruan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.