A field manual for engineering production spatiotemporal & movement-data pipelines in Python.
Spatiotemporal Movement is a deep, continually growing engineering reference for the people who build mobility analytics: mobility data scientists, urban analysts, Python GIS developers, and logistics/transportation engineering teams. Every page is a self-contained, executable guide — grounded in coordinate and temporal precision, production-ready Python, and the messy reality of debugging real-world movement data, not theoretical GIS overviews.
Each guide ships with complete, runnable code (typed signatures, explicit edge cases, vectorized patterns that scale past notebooks), hand-authored diagrams, validation strategies, and a tight web of cross-links so you can move from a symptom to a fix in a couple of clicks.
The material is organised into four sections, each broken into narrowly scoped topics:
- Spatiotemporal Data Foundations & Structures — trajectory object design, coordinate reference systems, GPS precision & error handling, sampling-rate optimization, time-series synchronization, and spatial storage formats (GeoParquet).
- Movement Pattern Extraction & Trajectory Analysis — trajectory segmentation, stay-point detection, speed/acceleration profiling, directionality & turn analysis, and movement similarity & clustering (Fréchet, DTW).
- Temporal Aggregation & Window Mapping — dynamic time-binning, rolling statistics, gap filling in sparse trajectories, seasonal/cyclical alignment, and cross-border time-series synchronization.
- Spatial Indexing & Density Aggregation — discrete global grids (H3 / S2 / quadkey), map-matching to road networks (HMM), origin-destination flow matrices, and kernel density surfaces.
- Handling GPS Drift in Raw Trajectory Logs
- H3 vs S2 vs Quadkey for Mobility Density Grids
- Feeding Cleaned GPS Output into an HMM Map-Matcher
- DBSCAN for Stay-Point Clustering in Python
- Kalman Filter Gap Filling for GPS Dropouts
pandas · polars · geopandas · shapely · pyproj · movingpandas · scikit-mobility
· scipy · scikit-learn · h3 · s2 · osmnx · rasterio · pyarrow / GeoParquet · duckdb
Every code sample follows the same discipline the guides preach: all distance, speed, and
acceleration math is done in a metric projected CRS (never raw EPSG:4326), timestamps are
UTC-first, and window boundaries are deterministic.
A static site generated with Eleventy, authored in Markdown with inline, hand-authored SVG diagrams and structured data (JSON-LD). It is deployed to Cloudflare Pages.
npm install
npm run build # build the static site into _site/
npm run serve # local dev server on http://localhost:8080Every page is held to a strict, automated quality bar — accessibility (WCAG 2 A/AA via axe-core), valid structured data, internal-link integrity, responsive layout, unique SEO metadata, and a Lighthouse performance budget — before it ships.
Spotted an error, or want a topic covered? Open an issue on this repository. Corrections to code, thresholds, and edge-case handling are especially welcome.
Built and maintained by Spatiotemporal Movement.