MobilityDB is an open source software program that adds support for temporal and spatio-temporal objects to the PostgreSQL object-relational database and its spatial extension PostGIS. MobilityDB follows the Moving Features specification from the Open Geospatial Consortium (OGC). Technically, MobilityDB is implemented as a PostgreSQL external extension.
Database adapters to access MobilityDB from Python are also available
- python-mobilitydb supports both the psycopg2 and the asyncpg adapters for PostgreSQL and uses the postgis adapter for PostGIS. This package is developed by the MobilityDB Team.
- MobilityDB SQLAlchemy is another independent package that provides extensions to SQLAlchemy for interacting with MobilityDB.
- Time types
TimestampSetwhich, in addition of the the
TimestampTztype provided by PostgreSQL, are used to represent time spans.
- Temporal types
ttextwhich are based on the
texttypes provided by PostgreSQL and are used to represent basic types that evolve on time.
- Spatio-temporal types
tgeogpointwhich are based on the
geographytypes provided by PostGIS (restricted to 2D or 3D points) and are used to represent points that evolve on time.
- Range types
floatrangewhich are used to represent ranges of
All these types have associated an extensive set of functions and operators. GiST and SP-GIST index support for these types are also provided.
The extension is under development. We are planning to release the first version at the begining of 2020.
- Linux (other UNIX-like systems may work, but remain untested)
- PostgreSQL == 11
- CMake >= 3.1
- PostGIS == 2.5
- Development files for PostgreSQL, PostGIS/liblwgeom, PROJ & JSON-C
Example for Debian-based systems:
# install all MobilityDB build dependencies apt install build-essential cmake postgresql-server-dev-11 liblwgeom-dev libproj-dev libjson-c-dev
Building & installation
Here is the gist:
$ git clone https://github.com/ULB-CoDE-WIT/MobilityDB $ mkdir MobilityDB/build $ cd MobilityDB/build $ cmake .. $ make $ sudo make install $ psql -c 'CREATE EXTENSION MobilityDB CASCADE'
You should also set the following in postgresql.conf:
shared_preload_libraries = 'postgis-2.5' max_locks_per_transaction = 128
A docker container with MobilityDB and all its dependencies is available. If you have docker installed in your system you can run:
docker pull codewit/mobilitydb docker volume create mobilitydb_data docker run --name "mobilitydb" -d -p 25432:5432 -v mobilitydb_data:/var/lib/postgresql codewit/mobilitydb
The first command is to download the latest most up-to-date image of MobilityDB. The second command creates a volume container on the host, that we will use to persist the PostgreSQL database files outside of the MobilityDB container. The third command executes this binary image of PostgreSQL, PostGIS, and MobilityDB with the TCP port 5432 in the container mapped to port 25432 on the Docker host (user = pw = docker, db = mobilitydb). This image is based on this docker container, please refer to it for more information.
Please report any issues at the address
- Mohamed Bakli, Mahmoud Sakr, Esteban Zimányi, Distributed Moving Object Data Management in MobilityDB. In Proc. of the 8th ACM SIGSPATIAL International Workshop on Analytics for Big Geospatial Data, BigSpatial 2019. Slides.
- Esteban Zimányi, Mahmoud Sakr, Arthur Lesuisse, Mohamed Bakli, MobilityDB: A Mainstream Moving Object Database System. In Proc. of the 16th International Symposium on Spatial and Temporal Databases, SSTD 2019, p. 206-209. ACM. Best Demo Paper Award. Poster
- Alejandro A. Vaisman, Esteban Zimányi: Mobility Data Warehouses. ISPRS International Journal of Geo-Information, 8(4): 170, 2019.
- Extending PostgreSQL With Spatiotemporal Data Management, PGConf.Russia, February 4, 2020, Moscow, Russia
- Road public transport in Moscow analysis: from PostGIS to MobilityDB, PGConf.Russia, February 4, 2020, Moscow, Russia,
- Managing Mobility Data in PostgreSQL, FOSSDEM PGDay, January 31, 2020, Brussels, Belgium
- Trajectory Data Analysis Using MobilityDB, FOSSDEM GeoSpatial Devroom, February 2, 2020, Brussels, Belgium
- MobilityDB: A PostgreSQL-PostGIS extension for mobility data management, FOSS4G Belgium, 2019.
- MobilityDB: A PostgreSQL extension for mobility data management, PGConf.Russia, 2019.
- MobilityDB: A Spatiotemporal Data Management Extension of PostgreSQL and PostGIS, Postgres Conference, March 24, 2020, New York, USA
- MobilityDB: Managing Mobility Data in PostgreSQL, Keynote speach at the joint EDBT/ICDT 2020 workshop on Big Mobility Data Analytics, BMDA 2020, March 30, 2020, Copenhagen, Denmark
Nina Belyavskaya works at Mosgortrans Mobility Department, whose mission to optimize road public transport routes and timetables in Moscow, Russia. She reported her experience of migrating from PostGIS to MobilityDB in PGConf.Russia
MobilityDB is provided under the PostgreSQL license.