/StreamingTrajSegment

Primary LanguageJavaGNU Affero General Public License v3.0AGPL-3.0

Streaming Trajectory Segmentation Based on Stay-Point Detection


STEP is an efficient and effective streaming trajectory algorithm.

STEP feature

  • STEP can rely only on recent data and a few features to efficiently divide trajectories into meaningful trajectory segments.
  • STEP propose a well-designed grid index and three areas to prune unnecessary distance calculations effectively, accelerating the process of trajectory segmentation in streaming environments.

Project Structure

This project mainly includes the following various trajectory segmentation algorithms:

  • The main code for the STEP algorithm is in the org/urbcomp/sts/method/step package.

  • The main code for the SPD algorithm is in the org/urbcomp/sts/method/spd package.

  • The main code for the SWS algorithm is in the org/urbcomp/sts/method/sws package.

For each method there is a corresponding executor, located in the org/urbcomp/sts/executor package.

STEP Structure

STEP consists of three modules, Input, Trajectory Segmentation and Stay Point Detection, where Stay Point Detection in turn contains two operations Identifying and Merging.

Stay Point Detection

The purpose of this operation is to detect the streaming stay points of the newly input GPS point, including both the discovery of new stay point and the merging of stay points.

Trajectory Segmentation

The purpose of this operation is to segment the trajectory according to the segmentation conditions to reduce the stress on the memory from a large number of trajectory points.

Test STEP

The default parameters are set according to the table below and can be adjusted for different data sets.

Parameter Range Default
D 10m,20m,50m,75m,100m 50m
T 1min,3min,5min,10min,15min 15min
n 1,3,5,7,10,15,20,25,30 20
o 1w,3w,5w,10w 3w
window size of SWS 7 7

Prerequisites for testing

The following resources need to be downloaded and installed:

Download and install jdk-8, IntelliJ IDEA and git. IntelliJ IDEA's maven project comes with maven, you can also use your own maven environment, just change it in the settings.

Clone code

  1. Open IntelliJ IDEA, find the git column, and select Clone...

  2. In the Repository URL interface, Version control selects git

  3. URL filling: https://github.com/Spatio-Temporal-Lab/StreamingTrajSegment.git

Set JDK

File -> Project Structure -> Project -> Project SDK -> add SDK

Click JDK to select the address where you want to download jdk-8

Test STEP

Select the org/urbcomp/sts package in the test folder, which includes tests for Latency&Throughput and F1-score.

Path Setting

In order to simulate the streaming of gps points, you can split the data set into multiple files and read them in sequence. For example, write the first GPS point in the data set to the object-1.txt file and put it in the object folder.

Datasets

Geolife dataset can be found in following linkļ¼Œdatasets CQ-Taxi and CQ-Hazs are not publicly available for the time being, and public data sets such as T-drive can be used instead.