mobilitydb
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
mobilitydb | 1.3.0 | GIS | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 1650 | mobilitydb | No | Yes | Yes | Yes | No | No | - |
| 1651 | mobilitydb_datagen | No | No | No | Yes | No | Yes | - |
| Related | postgis h3 pgrouting postgis pg_polyline q3c pg_sphere pointcloud pg_geohash qdgc pg_eviltransform |
|---|---|
| Depended By | mobilitydb_datagen |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | MIXED | 1.3.0 | 1817161514 | mobilitydb | postgis |
| RPM | PIGSTY | 1.3.0 | 1817161514 | mobilitydb_$v | postgis36_$v |
| DEB | PGDG | 1.3.0 | 1817161514 | postgresql-$v-mobilitydb | postgresql-$v-postgis-3 |
Build
You can build the RPM packages for mobilitydb using pig build:
Install
You can install mobilitydb directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Preload:
Create Extension:
Usage
Sources: repo README, MobilityDB 1.3 manual, v1.3.0 release
MobilityDB extends PostgreSQL and PostGIS with temporal and spatio-temporal data types, enabling efficient storage, indexing, and querying of moving object data such as vehicle trajectories, sensor readings, and time-varying attributes.
Key Documentation:
- MobilityDB Manual
- Temporal Types
- Spatial-Temporal Types
- Temporal Poses
- Temporal Circular Buffers
- Indexing
- MobilityDB Workshop
- API Reference
Getting Started
MobilityDB requires PostGIS. Enable both extensions:
Temporal Types
MobilityDB provides temporal variants of base types:
| Temporal Type | Base Type | Description |
|---|---|---|
tbool | boolean | Time-varying boolean |
tint | integer | Time-varying integer |
tfloat | float | Time-varying float |
ttext | text | Time-varying text |
tgeometry | geometry | Time-varying arbitrary geometry |
tgeography | geography | Time-varying arbitrary geography |
tgeompoint | geometry(Point) | Time-varying geometric point |
tgeogpoint | geography(Point) | Time-varying geographic point |
tnpoint | network point | Time-varying network point |
tcbuffer | circular buffer | Time-varying circular buffer |
tpose | pose | Time-varying point position and orientation |
trgeometry | rigid geometry | Time-varying rigid geometry |
MobilityDB 1.3 adds tgeometry, tgeography, tcbuffer, tpose, and trgeometry. tgeometry and tgeography support discrete or step interpolation, not linear interpolation of arbitrary geometries. The 1.3 release notes mark tcbuffer, tpose, and trgeometry as experimental.
Temporal Subtypes
Each temporal type can be represented in different subtypes depending on how values change over time:
| Subtype | Description | Example |
|---|---|---|
| Instant | Single value at a single timestamp | '25.5@2025-01-01 08:00' |
| Sequence | Continuous values over a time interval | '[25.5@08:00, 28.1@09:00, 30.0@10:00]' |
| SequenceSet | Set of non-overlapping sequences | '{[25.5@08:00, 28.1@09:00], [30.0@11:00, 31.2@12:00]}' |
Sequences use brackets to indicate inclusive [ or exclusive ( bounds, just like PostgreSQL range types.
Creating Temporal Values
Instant values:
Sequence values (continuous interpolation):
Discrete sequences (stepwise interpolation):
SequenceSet values:
Constructing from components:
Temporal Operations
Extracting values at a specific time:
Restricting to a time period:
Getting the time span of a temporal value:
Temporal comparisons:
Spatial-Temporal Operations
Trajectory: extract the spatial path as a geometry:
Speed calculation:
Length of trajectory:
Space-time bounding box (stbox):
Spatial restriction: values within an area:
Distance between two temporal points:
Nearest approach distance and time:
Indexing
MobilityDB supports GiST and SP-GiST indexes for efficient temporal and spatio-temporal queries.
SP-GiST index for temporal types (time dimension):
GiST index for spatio-temporal types (space + time):
These indexes accelerate bounding box queries, temporal overlap checks, and spatial-temporal intersection:
Example: Vehicle Tracking
A complete example storing and querying vehicle GPS trajectories:
Example: Spatio-Temporal Intersection Query
Find all trips that passed through a specific area during a given time window:
Aggregate Functions
MobilityDB provides temporal aggregates:
Caveats
- The catalog package and extension are both
mobilitydbversion1.3.0; the packaged matrix targets PostgreSQL 14 through 18 and requirespostgis. - The v1.3.0 release adds PostgreSQL 18 and PostGIS 3.6 support, but its migration note says the binary format changed from MobilityDB 1.2, so upgrades from 1.2 require backup and restore.
- Upstream source-build notes show
shared_preload_libraries = 'postgis-3'andmax_locks_per_transaction = 128before loading MobilityDB. Validate those settings on clusters that are not using packaged defaults. - The local package metadata still carries the curation comment
need another schema; upstream docs did not confirm a separate required schema, so avoid schema-specific guidance until that note is resolved.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)