Learn
Guides for mobility researchers, grouped by what you want to do. Start at chapter 1 if this is your first time. Each chapter mixes notebooks (run end to end in Colab or Binder from a clean environment, with real public data wherever possible, each stating its data source and download size) and concept pages (the ideas and the choices that change your results, with no code to run). Looking for a specific function? Use the API reference; each of its entries links to the notebook that runs it.
1. Getting started
What does mobility data look like, and how do I use it?
- Start with a trajectory: notebook, synthetic data. Build a trajectory table and compute your first four measures.
- Use your own columns and dataframe library: notebook, synthetic data. Non-standard column names, and pandas, Polars or PyArrow in and out.
2. Preparing trajectories
How do I turn noisy GPS fixes into trips, stops and places?
- Cleaning and segmentation: concept page. What to remove or split, and which choices change your results.
- Clean noisy GPS data and find stops: notebook, GeoLife. Filter glitches, split at gaps, thin the data, detect stops, group them into places.
- Fill gaps, smooth, compare and convert trajectories: notebook, GeoLife. Local time, filling recording gaps, smoothing, trajectory distance, grids and tilers, shape clustering, GeoPandas, file round trip.
- Stops and locations: concept page. Staypoints, locations and the positions-to-tours hierarchy.
- Build the trajectory hierarchy: stops, trips and tours: notebook, GeoLife. Staypoints, places, home and work, triplegs, transport mode, trips and tours.
3. Measuring mobility
How far, how often and how predictably do people move, and where does the population go?
- Measuring people and populations: concept page. Which measure answers which question, and its units.
- Measure individual mobility: notebook, Brightkite. Range, places, entropy, home and work for hundreds of users.
- Routine, predictability and mobility profiles: notebook, GeoLife. Regularity, entropy, predictability, return and exploration, activity profiles.
- Find daily mobility motifs: notebook, GeoLife. The shape of each person's day.
- Population measures: notebook, Brightkite. Homes and visits per place, spread over time, diversity of visitors.
- Flows between places: notebook, Brightkite. Origin-destination flows, zones, and comparing two flow tables.
- Occupancy and phone records: notebook, Brightkite and synthetic call records. When places are busy, shared visitors, stays and trips from phone records.
4. Spatial and network analysis
What happens on the road network, and who meets whom?
- Roads, rails and map matching: concept page. Graphs, snapping, map matching and route flows.
- Road networks: matching, routing and route flows: notebook, GeoLife and Overture Maps. Match a trace, route, compare road and straight-line distance, join points of interest and events.
- Contact networks from stays: notebook, Brightkite. Co-presence contacts, structure against a random baseline, Friends, Bridges, Acquaintances.
5. Modelling, evaluating and protecting
Which law or model describes my data, how well, and how identifiable are the people in it?
- Compare your data to mobility laws: notebook, Brightkite. Jump lengths, the visitation law and daily places.
- How the fits work: concept page. The estimators behind the distance and gravity fits, their uncertainty and what to report.
- Validate against census flows: notebook, synthetic reference table and Brightkite. Home-to-work flows from trajectories, expansion weights, gravity distance decay with a confidence interval, gravity against radiation.
- Validate mobility with GeoLife: notebook, GeoLife GPS tracks. The full cycle from raw tracks to a distance law with confidence intervals, a gravity distance-decay parameter, and a held-out gravity against radiation comparison.
- Generate mobility with models: notebook, synthetic data. Exploration and return models, diaries, social ties, gravity and radiation flows.
- Fit and compare distributions: notebook, Brightkite. Error, information, distribution and common-part metrics.
- Privacy risk of trajectories: notebook, Brightkite. Re-identification risk under eight attacker models.
6. Charting results
How do I draw what I measured?
- Chart your results: notebook, Brightkite and GeoLife. Distributions, bars, boxes, scatters and heatmaps from any result, and the charts for activities, mobility profiles, motifs and fitted laws.