Need advice about which tool to choose?Ask the StackShare community!

OSRM

32
83
+ 1
0
pgRouting

10
24
+ 1
8
Add tool

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.

Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of OSRM
Pros of pgRouting
    Be the first to leave a pro
    • 3
      Dynamic routing
    • 1
      Routing in the database
    • 1
      Open Source
    • 1
      Data changes are reflected instantaneously
    • 1
      Geospatial network analysis
    • 1
      QGIS plugin

    Sign up to add or upvote prosMake informed product decisions

    - No public GitHub repository available -

    What is OSRM?

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

    What is pgRouting?

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

    Need advice about which tool to choose?Ask the StackShare community!

    What companies use OSRM?
    What companies use pgRouting?
    Manage your open source components, licenses, and vulnerabilities
    Learn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with OSRM?
    What tools integrate with pgRouting?
    What are some alternatives to OSRM and pgRouting?
    Valhalla
    Valhalla is Mapzen’s open-source routing service for client-side routing applications and hosted solutions. If you are looking to avoid the challenge of data creation and database administration, you can get high-quality routes and navigational guidance with clear directions through a simple API call.
    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.
    JavaScript
    JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles.
    Git
    Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
    GitHub
    GitHub is the best place to share code with friends, co-workers, classmates, and complete strangers. Over three million people use GitHub to build amazing things together.
    See all alternatives