Journal Article

spanishoddata: a package for accessing and working with Spanish Open Mobility Big Data

Kotov, E., Vidal-Tortosa, E., García Cantú Ros, O., Burrieza-Galán, J., Herranz, R., Gullón Muñoz-Repiso, T., Lovelace, R.
Environment and Planning B: Urban Analytics and City Science (2026)
Open Access
Reproducible

Abstract

We present spanishoddata, an R package that enables fast and efficient access to Spain’s open, high-resolution origin-destination human mobility datasets, derived from anonymised mobile-phone records and released by the Ministry of Transport and Sustainable Mobility. The package directly addresses challenges of data accessibility, reproducibility, and efficient processing identified in prior studies. spanishoddata automates retrieval from the official source, performs file and schema validation, and converts the data to efficient, analysis-ready formats (DuckDB and Parquet) that enable multi-month and multi-year analysis on consumer-grade hardware. The interface handles complexities associated with these datasets, enabling a wide range of people – from data science beginners to experienced practitioners with domain expertise – to start using the data with just a few lines of code. We demonstrate the utility of the package with example applications in urban transport planning, such as assessing cycling potential or understanding mobility patterns by activity type. By simplifying data access and promoting reproducible workflows, spanishoddata lowers the barrier to entry for researchers, policymakers, transport planners or anyone seeking to leverage mobility datasets.
Supplementary materials 
Data and reproducible R code 
Related materials
Workshop materials for Analysing massive open human mobility data using spanishoddata, duckdb and flowmaps (Applied Geoinformatics (AGIT) Conference 2025. Salzburg, Austria)
Tutorial materials for Mobility Flows and Accessibility Using R and Big Open Data (IC2S2 (11th International Conference on Computational Social Science), Norrköping, Sweden)

Keywords: Spain, data analysis, data processing, human geography, spatial analysis
Max-Planck-Gesellschaft - Logo
The Max Planck Institute for Demographic Research (MPIDR) in Rostock is one of the leading demographic research centers in the world. It's part of the Max Planck Society, the internationally renowned German research society.