StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Follow on

© 2025 StackShare. All rights reserved.

Product

  • Stacks
  • Tools
  • Feed

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  1. Stackups
  2. Utilities
  3. API Tools
  4. Mapping Apis
  5. OSRM vs pgRouting

OSRM vs pgRouting

OverviewComparisonAlternatives

Overview

OSRM
OSRM
Stacks34
Followers85
Votes0
GitHub Stars7.2K
Forks3.8K
pgRouting
pgRouting
Stacks10
Followers24
Votes8

OSRM vs pgRouting: What are the differences?

Introduction

This markdown document compares the key differences between OSRM and pgRouting, two popular routing libraries for geographic information systems (GIS). Both OSRM and pgRouting are open-source and provide functionality for routing and navigation. However, they differ in various aspects, as described below.

  1. Routing Algorithm: OSRM (Open Source Routing Machine) uses the contraction hierarchies algorithm for routing. This algorithm pre-processes the road network to create a hierarchy of shortcuts, which enables faster route calculations. On the other hand, pgRouting offers multiple routing algorithms, including Dijkstra's algorithm, A* algorithm, and many more. Each algorithm has its own trade-offs in terms of performance and accuracy.

  2. Data Storage: OSRM employs a highly optimized custom data storage format, which allows fast read access and efficient memory usage. It compresses the road network graph into a compact form, optimizing the storage and retrieval of routing information. Meanwhile, pgRouting uses the PostgreSQL database management system for data storage. It leverages the power of a relational database to store and query routing-related data efficiently.

  3. Routing Constraints: OSRM provides limited support for routing constraints and requires the programmer to implement custom solutions for constraints like toll roads, vehicle restrictions, time-dependent routing, etc. On the other hand, pgRouting offers built-in support for various routing constraints, such as restrictions based on road attributes (e.g., road type, maximum speed), turn restrictions, and time-dependent routing.

  4. Network Analysis Features: pgRouting offers a more extensive set of network analysis features compared to OSRM. It provides capabilities for calculating shortest paths, calculating driving distance matrices, finding the nearest facility, and solving the traveling salesman problem (TSP). OSRM, on the other hand, focuses primarily on efficient routing calculations, with limited support for network analysis beyond basic shortest-path calculations.

  5. Integration with Existing Tools: pgRouting seamlessly integrates with the PostgreSQL ecosystem, allowing easy integration with other GIS tools and databases. It leverages the rich set of PostgreSQL features, including spatial indexing, spatial queries, and data manipulation capabilities. OSRM, although it can be used with various programming languages and frameworks, does not have the same level of integration with the broader GIS ecosystem.

  6. Popularity and Community Support: OSRM has gained significant popularity and has an active community of users and contributors. It is widely adopted and used in various projects, which ensures ongoing development and support. pgRouting also has a dedicated user community, but it is relatively less known and popular compared to OSRM.

In Summary, OSRM and pgRouting differ in terms of routing algorithm, data storage, routing constraints, network analysis features, integration with existing tools, and popularity/community support.

Share your Stack

Help developers discover the tools you use. Get visibility for your team's tech choices and contribute to the community's knowledge.

View Docs
CLI (Node.js)
or
Manual

Detailed Comparison

OSRM
OSRM
pgRouting
pgRouting

It is a C++ implementation of a high-performance routing engine for shortest paths in road networks

It is an extension of PostGIS and PostgreSQL geospatial database and adds routing and other network analysis functionality.

Flexible import of OpenStreetMap data; Handles continental sized networks within milliseconds; Supports car, bicycle, walk modes; easily customized through profiles
All Pairs Shortest Path, Johnson’s Algorithm; All Pairs Shortest Path, Floyd-Warshall Algorithm; Shortest Path A*; Bi-directional Dijkstra Shortest Path; Bi-directional A* Shortest Path; Shortest Path Dijkstra; Driving Distance; K-Shortest Path, Multiple Alternative Paths; K-Dijkstra, One to Many Shortest Path; Traveling Sales Person; Turn Restriction Shortest Path (TRSP)
Statistics
GitHub Stars
7.2K
GitHub Stars
-
GitHub Forks
3.8K
GitHub Forks
-
Stacks
34
Stacks
10
Followers
85
Followers
24
Votes
0
Votes
8
Pros & Cons
No community feedback yet
Pros
  • 3
    Dynamic routing
  • 1
    Open Source
  • 1
    Data changes are reflected instantaneously
  • 1
    Geospatial network analysis
  • 1
    QGIS plugin
Integrations
C++
C++
GitHub
GitHub
JavaScript
JavaScript
PostgreSQL
PostgreSQL
PostGIS
PostGIS

What are some alternatives to OSRM, pgRouting?

dbForge Studio for MySQL

dbForge Studio for MySQL

It is the universal MySQL and MariaDB client for database management, administration and development. With the help of this intelligent MySQL client the work with data and code has become easier and more convenient. This tool provides utilities to compare, synchronize, and backup MySQL databases with scheduling, and gives possibility to analyze and report MySQL tables data.

Google Maps

Google Maps

Create rich applications and stunning visualisations of your data, leveraging the comprehensiveness, accuracy, and usability of Google Maps and a modern web platform that scales as you grow.

dbForge Studio for Oracle

dbForge Studio for Oracle

It is a powerful integrated development environment (IDE) which helps Oracle SQL developers to increase PL/SQL coding speed, provides versatile data editing tools for managing in-database and external data.

dbForge Studio for PostgreSQL

dbForge Studio for PostgreSQL

It is a GUI tool for database development and management. The IDE for PostgreSQL allows users to create, develop, and execute queries, edit and adjust the code to their requirements in a convenient and user-friendly interface.

dbForge Studio for SQL Server

dbForge Studio for SQL Server

It is a powerful IDE for SQL Server management, administration, development, data reporting and analysis. The tool will help SQL developers to manage databases, version-control database changes in popular source control systems, speed up routine tasks, as well, as to make complex database changes.

Mapbox

Mapbox

We make it possible to pin travel spots on Pinterest, find restaurants on Foursquare, and visualize data on GitHub.

Leaflet

Leaflet

Leaflet is an open source JavaScript library for mobile-friendly interactive maps. It is developed by Vladimir Agafonkin of MapBox with a team of dedicated contributors. Weighing just about 30 KB of gzipped JS code, it has all the features most developers ever need for online maps.

Liquibase

Liquibase

Liquibase is th leading open-source tool for database schema change management. Liquibase helps teams track, version, and deploy database schema and logic changes so they can automate their database code process with their app code process.

Sequel Pro

Sequel Pro

Sequel Pro is a fast, easy-to-use Mac database management application for working with MySQL databases.

DBeaver

DBeaver

It is a free multi-platform database tool for developers, SQL programmers, database administrators and analysts. Supports all popular databases: MySQL, PostgreSQL, SQLite, Oracle, DB2, SQL Server, Sybase, Teradata, MongoDB, Cassandra, Redis, etc.

Related Comparisons

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot

Liquibase
Flyway

Flyway vs Liquibase