Home

Awesome

Build Status Coverage Status Codacy Badge Gitter

MobilityDB

An open source geospatial trajectory data management & analysis platform

<img src="doc/images/mobilitydb-logo.svg" width="200" alt="MobilityDB Logo" />

MobilityDB is a database management system for moving object geospatial trajectories, such as GPS traces. It adds support for temporal and spatio-temporal objects to the PostgreSQL database and its spatial extension PostGIS.

MobilityDB is developed by the Computer & Decision Engineering Department of the Université libre de Bruxelles (ULB) under the direction of Prof. Esteban Zimányi. ULB is an OGC Associate Member and member of the OGC Moving Feature Standard Working Group (MF-SWG).

<img src="doc/images/OGC_Associate_Member_3DR.png" width="100" alt="OGC Associate Member Logo" />

The MobilityDB project is managed by a steering committee.

More information about MobilityDB, including publications, presentations, etc., can be found in the MobilityDB website.

Documentation

The pregenerated user and developer documentation can be found here.

To generate the documentation locally, refer to our documentation generation section

Benefits

Experimental Projects

These projects push the boundaries of MobilityDB and connect it with the PostgreSQL/PostGIS ecosystem.

Cloud

Visualization

Public Transport

Mailing Lists

There are two mailing lists for MobilityDB hosted on OSGeo mailing list server:

For general questions and topics about how to use MobilityDB, please write to the user mailing list.

Branches

The complete list of releases is available here

Requirements

For example, you can build the following command to install all MobilityDB build dependencies for Debian-based systems using PostgreSQL 16 and PostGIS 3:

apt install build-essential cmake postgresql-server-dev-16 libgeos-dev libproj-dev libjson-c-dev libgsl-dev

Building & Installation

Here is the gist:

git clone https://github.com/MobilityDB/MobilityDB
mkdir MobilityDB/build
cd MobilityDB/build
cmake ..
make
sudo make install

You should also set the following in postgresql.conf depending on the version of PostGIS you have installed (below we use PostGIS 3):

shared_preload_libraries = 'postgis-3'
max_locks_per_transaction = 128

If you do not preload the PostGIS library you will not be able to load the MobilityDB library and will get an error message such as the following one

ERROR:  could not load library "/usr/local/pgsql/lib/libMobilityDB-1.0.so": undefined symbol: ST_Distance

Notice that you can find the location of the postgresql.conf file as given next:

$ which postgres
/usr/local/pgsql/bin/postgres
$ ls /usr/local/pgsql/data/postgresql.conf
/usr/local/pgsql/data/postgresql.conf

As can be seen, the PostgreSQL binaries are in the bin subdirectory while the postgresql.conf file is in the data subdirectory.

Once MobilityDB is installed, it needs to be enabled in each database you want to use it in. In the example below we use a database named mobility.

createdb mobility
psql mobility -c "CREATE EXTENSION PostGIS"
psql mobility -c "CREATE EXTENSION MobilityDB"

Docker Container

Docker images with MobilityDB and all its dependencies are available here. These images are based on the official Postgres and Postgis docker images, please refer to them for more information.

If you have docker installed in your system you can run:

docker pull mobilitydb/mobilitydb
docker volume create mobilitydb_data
docker run --name mobilitydb -e POSTGRES_PASSWORD=mysecretpassword \
  -p 25432:5432 -v mobilitydb_data:/var/lib/postgresql -d mobilitydb/mobilitydb
psql -h localhost -p 25432 -U postgres

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 = postgres, db = postgres, pw=mysecretpassword). The fourth command is to connect to the database using psql.

Note that you can define the environment variable PGPASSWORD to avoid an interactive pw prompt.

PGPASSWORD=mysecretpassword psql -h localhost -p 25432 -U postgres

Issues

Please report any issues you may have.

Generating the Documentation

Pregenerated versions of the user and developer documentation can be found here.

User's Manual

You can generate the user's manual in HTML, PDF, and EPUB formats. The manual is generated in English and in other available languages (currently only Spanish). For this, it is necessary to specify appropriate options in the cmake command as follows:

For example, the following command generates the documentation in all formats and in all languages.

cmake -D DOC_ALL=true -D LANG_ALL=true ..
make doc

As another example, the following command generates the English documentation in PDF.

cmake -D DOC_PDF=true ..
make doc

The resulting documentation will be generated in the doc directory of the build directory.

Developer's Documentation

You can generate the English developer's documentation in HTML format. For this, it is necessary to the option DOC_DEV in the cmake command as follows:

cmake -D DOC_DEV=true ..
make doc_dev

The resulting HTML documentation will be generated in the doxygen directory of the build directory.

Licenses