Table of Contents

pgRouting extends the PostGIS/PostgreSQL geospatial database to provide geospatial routing and other network analysis functionality.

This is the manual for pgRouting v3.8.0.

Creative Commons Attribution-Share Alike 3.0 License

The pgRouting Manual is licensed under a Creative Commons Attribution-Share Alike 3.0 License. Feel free to use this material any way you like, but we ask that you attribute credit to the pgRouting Project and wherever possible, a link back to https://pgrouting.org. For other licenses used in pgRouting see the Licensing page.

General

  • Sample Data that is used in the examples of this manual.

Pgrouting Concepts

Function Families

All Pairs - Family of Functions

A* - Family of functions

Bidirectional A* - Family of functions

Bidirectional Dijkstra - Family of functions

Components - Family of functions

Contraction - Family of functions

Dijkstra - Family of functions

Flow - Family of functions

Kruskal - Family of functions

Metrics - Family of functions

  • pgr_degree - Returns a set of vertices and corresponding count of incident edges to the vertex.

Prim - Family of functions

Reference

Topology - Family of Functions

The following functions modify the database directly therefore the user must have special permissions given by the administrators to use them.

Traveling Sales Person - Family of functions

pgr_trsp - Proposed - Turn Restriction Shortest Path (TRSP)

Utilities

Functions by categories

Cost - Category

Cost Matrix - Category

Driving Distance - Category

K shortest paths - Category

  • pgr_KSP - Yen’s algorithm based on pgr_dijkstra

Spanning Tree - Category

BFS - Category

DFS - Category

Available Functions but not official pgRouting functions

Release Notes

pgRouting 3.8.0 Release Notes

To see all issues & pull requests closed by this release see the Git closed milestone for 3.8.0

Promotion to official function of pgRouting.

Metric

  • #2760: Promoted to official pgr_degree in version 3.8

    • Error messages adjustment.

    • New signature with only Edges SQL.

    • Function promoted to official.

Utilities

  • #2772: Promoted to official pgr_extractVertices in version 3.8

    • Error messages adjustment.

    • Function promoted to official.

  • #2774: Promoted to official pgr_findCloseEdges in version 3.8

    • Error messages adjustment.

    • partial option is removed.

    • Function promoted to official.

  • #2873: Promoted to official pgr_separateCrossing in version 3.8

    • Function promoted to official.

    • Proposed function.

  • #2874: Promoted to official pgr_separateTouching in version 3.8

    • Function promoted to official.

    • Proposed function.

Proposed functions

Contraction

  • #2790: pgr_contractionDeadEnd new contraction function

  • #2791: pgr_contractionLinear new contraction function

  • #2536: Support for contraction hierarchies (pgr_contractionHierarchies)

Utilities

  • #2848: Create pgr_separateCrossing new utility function

  • #2849: Create of pgr_separateTouching new utility function

Official functions changes

  • #2786: pgr_contraction(edges) new signature

    • New signature:

      • Previously compulsory parameter Contraction order is now optional with name methods.

      • New name and order of optional parameters.

    • Deprecated signature pgr_contraction(text,bigint[],integer,bigint[],boolean)

C/C++ code enhancements

  • #2802: Code reorganization on pgr_contraction

  • Other enhancements: #2869

SQL code enhancements

  • #2850: Rewrite pgr_nodeNetwork

Deprecation of SQL functions

  • #2749: Deprecate pgr_AlphaShape in 3.8

  • #2750: Deprecate pgr_CreateTopology in 3.8

  • #2753: Deprecate pgr_analyzeGraph in 3.8

  • #2754: Deprecate pgr_analyzeOneWay in 3.8

  • #2826: Deprecate pgr_createVerticesTable in 3.8

  • #2847: Deprecate pgr_nodeNetwork in 3.8

In the deprecated functions:

  • Migration section is created.

  • The use of the functions is removed in the documentation.

All releases

Indices and tables