search_similar_trajectory

Search JSONL trajectory records by coordinates, distance, and duration.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/bettercallfan/deerflow --skill search-similar-trajectory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: search_similar_trajectory
Source: https://github.com/bettercallfan/deerflow/tree/main/skills/custom/spatiotemporal_trajectory/search_similar_trajectory
Command: npx skills add https://github.com/bettercallfan/deerflow --skill search-similar-trajectory

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill simplifies the task of identifying trajectory records that are similar to a given trip, based on common attributes such as start/end position, travel distance, and duration.

Core Features & Use Cases

  • Identify Similar Trips: Efficiently find and retrieve historical trajectory records that share similar characteristics with a target trip.
  • Use Cases: Ideal for explaining route anomalies, comparing commute groups, or retrieving historical case studies.
  • Algorithm: Uses trip feature vectorization, coordinate comparison, and nearest-neighbor ranking to match trajectories.

Quick Start

Execute the following command to search for similar trips based on a provided target trip ID and output the results.

python3 scripts/search_similar_trajectory.py \
  --input /path/to/trips.jsonl \
  --output-dir /path/to/output \
  --target-trip-id trip_000001 \
  --top-k 10

Replace /path/to/trips.jsonl with the actual path to your trip data file and /path/to/output with the desired output directory.

Frequently Asked Questions about search_similar_trajectory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find similar trajectory records based on start and end coordinates?

To find similar trajectory records, you can use a nearest-neighbor ranking algorithm that vectorizes trip features like start and end coordinates, travel distance, and duration to match and retrieve comparable historical trips.

What is trajectory matching for mobility analysis and when do I need it?

Trajectory matching is the process of comparing spatiotemporal trip features to identify similar historical records. You need it when comparing commute groups, explaining route anomalies, or retrieving historical case studies for mobility analysis.

Can I search JSONL trip data for matching trajectories using a specific target trip ID?

Yes, you can search JSONL trip data by providing a target trip ID. The script processes the input JSONL file, compares the target trip against other records, and outputs a JSONL file containing the top-k matched trajectories.

Does trajectory comparison require any specific data formats or external dependencies?

Trajectory comparison requires input trip data to be in JSONL format. The process operates as a standalone script with no external dependencies, directly reading JSONL files and outputting matched records in the same format.

What's the best way to compare historical trips to identify route anomalies?

The best way to compare historical trips is to vectorize trip attributes such as start and end positions, travel distance, and duration, then apply nearest-neighbor ranking to retrieve similar trajectory records for anomaly analysis.

How do I limit the number of matched trajectories returned from a mobility analysis search?

You can limit the number of matched trajectories by specifying the top-k parameter in the search script. This restricts the output JSONL file to only include the top-ranked similar records for your target trip.