detect_trajectory_cooccurrence

Detect trajectory co-occurrence by comparing staypoints within spatial and temporal boundaries.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires geohash, json, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of detecting the presence of multiple trajectories at the same location during overlapping time intervals.

Core Features & Use Cases

  • Trajectory Co-occurrence Detection: Identify when user pairs or groups are present at the same geohash cell with overlapping dwell time.
  • Use Case: Ideal for applications requiring companion trajectory detection, contact tracing, crowd gathering analysis, or understanding group dynamics in shared spaces.
  • Examples: Finding out which pairs of individuals in a dataset have crossed paths during a specified time window.

Quick Start

Detect co-occurrence of multiple trajectories from the dataset 'data.jsonl' by running:

python3 scripts/detect_trajectory_cooccurrence.py --input /path/to/data.jsonl --output-dir /path/to/output

Frequently Asked Questions about detect_trajectory_cooccurrence

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

FAQPage Schema
How do I detect trajectory co-occurrence in a spatiotemporal dataset?

Detect trajectory co-occurrence by comparing staypoints from your dataset to find user pairs present in the same geohash cell with overlapping dwell times. This requires parsing staypoint files and using geohashing to calculate spatial overlaps.

Can I use JSON files for contact tracing trajectory analysis?

Yes, JSON files are supported for contact tracing trajectory analysis. You provide an input JSONL file containing staypoint data, and the script parses it to identify when multiple trajectories overlap within specific spatial and temporal boundaries.

What is geohashing used for in spatiotemporal trajectory analysis?

Geohashing is used in spatiotemporal trajectory analysis to calculate spatial overlaps by converting geographic coordinates into grid cells. This allows the system to identify when multiple users occupy the same spatial window during overlapping time intervals.

How do I find which individuals crossed paths in a specific time window?

To find which individuals crossed paths, run the detection script with your input staypoint dataset and an output directory. It identifies pairs of trajectories present at the same location with overlapping dwell times, outputting the co-occurrence results.

Do I need to preprocess staypoint data before detecting trajectory co-occurrence?

Yes, you need to process and parse staypoint files before detecting trajectory co-occurrence. The Skill requires a structured staypoint dataset as input to accurately compare trajectories and identify overlapping spatial and temporal boundaries.

What are the limitations of using geohash for trajectory co-occurrence detection?

Using geohash for trajectory co-occurrence detection limits spatial precision to the size of the geohash cell, meaning exact distances between users within the same cell are not calculated. It focuses purely on shared spatial boundaries and temporal overlaps rather than precise proximity.