Supported versions: latest (3.8) 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 main dev
Unsupported versions:2.6 2.5 2.4 2.3 2.2 2.1 2.0

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 v4.0.0-dev.

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

TRSP - Family of functions

Traveling Sales Person - Family of functions

Utility functions

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 4.0.0 Release Notes

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

Functions promoted to official

  • pgr_trsp

  • pgr_trspVia

  • pgr_trspVia_withPoints

  • pgr_trsp_withPoints

  • #2905 pgr_withPoints

    • Output columns standardized to (seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)

    • Function promoted to official.

  • #2905 pgr_withPointsCost

    • Output columns standardized to (start_vid, end_vid, agg_cost)

    • Function promoted to official.

  • pgr_withPointsCostMatrix

  • pgr_withPointsDD

  • pgr_withPointsKSP

  • pgr_withPointsVia

Signatures promoted to official

  • pgr_aStar(Combinations)

  • pgr_aStarCost(Combinations)

  • pgr_bdAstar(Combinations)

  • pgr_bdAstarCost(Combinations)

  • pgr_bdDijkstra(Combinations)

  • pgr_bdDijkstraCost(Combinations)

  • pgr_dijkstra(Combinations)

  • pgr_dijkstraCost(Combinations)

  • pgr_KSP(All signatures)

  • pgr_boykovKolmogorov(Combinations)

  • pgr_edmondsKarp(Combinations)

  • pgr_maxFlow(Combinations)

  • pgr_pushRelabel(Combinations)

SQL signatures modification on functions

  • #2906 pgr_bdDijkstra

    • Output columns standardized to (seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)

    • Combinations signature promoted to official.

Removal of SQL deprecated signatures

  • #2798: pgr_contraction

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

  • #2683: pgr_trsp

    • pgr_trsp(text,integer,integer,boolean,boolean,text)

    • pgr_trsp(text,integer,double precision,integer,double precision,boolean,boolean,text)

  • #2888: pgr_findCloseEdges

    • pgr_findcloseedges(text,geometry,double precision,integer,boolean,boolean)

    • pgr_findcloseedges(text,geometry[],double precision,integer,boolean,boolean)

  • #2890: pgr_withPointsDD

    • pgr_withpointsdd(text,text,anyarray,double precision,boolean,character,boolean,boolean)

    • pgr_withpointsdd(text,text,bigint,double precision,boolean,character,boolean)

  • #2895: pgr_withPointsKSP

    • pgr_withpointsksp(text,text,bigint,bigint,integer,boolean,boolean,character,boolean)

  • #2899: pgr_maxCardinalityMatch

    • pgr_maxcardinalitymatch(text,boolean)

  • #2901: TSP family

    • pgr_tsp(text,bigint,bigint,double precision,integer,integer,integer,double precision,double precision,double precision,boolean)

    • pgr_tspeuclidean(text,bigint,bigint,double precision,integer,integer,integer,double precision,double precision,double precision,boolean)

Removal of SQL deprecated functions

  • #2681: pgr_trspviaedges

  • #2682: pgr_trspviavertices

  • #2748: pgr_alphaShape

  • #2751: pgr_createTopology

  • #2752: pgr_analyzeGraph

  • #2755: pgr_analyzeOneWay

  • #2827: pgr_createVerticesTable

  • #2886: pgr_nodeNetwork

rubric:: Removal of SQL deprecated internal functions

Related issues: #2897

  • _pgr_dijkstranear(text,anyarray,anyarray,bigint,boolean)

  • _pgr_dijkstranear(text,anyarray,bigint,bigint,boolean)

  • _pgr_dijkstranear(text,bigint,anyarray,bigint,boolean)

  • _pgr_dijkstra(text,anyarray,anyarray,boolean,boolean,boolean,bigint)

  • _pgr_dijkstra(text,text,boolean,boolean,boolean)

  • _pgr_drivingdistance(text,anyarray,double precision,boolean,boolean)

  • _pgr_ksp(text,anyarray,anyarray,integer,boolean,boolean,boolean)

  • _pgr_ksp(text,bigint,bigint,integer,boolean,boolean)

  • _pgr_ksp(text,text,integer,boolean,boolean)

  • _pgr_kruskal(text,anyarray,text,bigint,double precision)

  • _pgr_maxcardinalitymatch(text,boolean)

  • _pgr_prim(text,anyarray,text,bigint,double precision)

  • _pgr_trsp(text,integer,double precision,integer,double precision,boolean,boolean,text)

  • _pgr_trsp(text,text,anyarray,anyarray,boolean)

  • _pgr_trsp(text,text,anyarray,bigint,boolean)

  • _pgr_trsp(text,text,bigint,anyarray,boolean)

  • _pgr_trsp(text,text,bigint,bigint,boolean)

  • _pgr_trspviavertices(text,integer[],boolean,boolean,text)

  • _pgr_withpointsdd(text,text,anyarray,double precision,boolean,character,boolean,boolean)

  • _pgr_withpointsksp(text,text,anyarray,anyarray,integer,character,boolean,boolean,boolean,boolean)

  • _pgr_withpointsksp(text,text,bigint,bigint,integer,boolean,boolean,character,boolean)

  • _pgr_withpointsksp(text,text,text,integer,character,boolean,boolean,boolean)

  • _pgr_withpointsvia(text,bigint[],double precision[],boolean)

  • _trsp(text,text,anyarray,anyarray,boolean)

  • _v4trsp(text,text,anyarray,anyarray,boolean)

  • _v4trsp(text,text,text,boolean)

  • _pgr_tspeuclidean(text,bigint,bigint,double precision,integer,integer,integer,double precision,double precision,double precision,boolean)

  • _pgr_tsp(text,bigint,bigint,double precision,integer,integer,integer,double precision,double precision,double precision,boolean)

  • #2861: Remove unused internal functions

    • _pgr_checkverttab(text,text[],integer,text)

    • _pgr_createindex(text,text,text,integer,text)

    • _pgr_createindex(text,text,text,text,integer,text)

    • _pgr_endpoint(geometry)

    • _pgr_getcolumnname(text,text,integer,text)

    • _pgr_getcolumnname(text,text,text,integer,text)

    • _pgr_getcolumntype(text,text,integer,text)

    • _pgr_getcolumntype(text,text,text,integer,text)

    • _pgr_gettablename(text,integer,text)

    • _pgr_iscolumnindexed(text,text,integer,text)

    • _pgr_iscolumnindexed(text,text,text,integer,text)

    • _pgr_iscolumnintable(text,text)

    • _pgr_msg(integer,text,text)

    • _pgr_onerror(boolean,integer,text,text,text,text)

    • _pgr_pointtoid(geometry,double precision,text,integer)

    • _pgr_quote_ident(text)

    • _pgr_startpoint(geometry)

    • _pgr_versionless(text,text)

Code enhancements

  • Removal of unused C/C++ code

  • Refactor the Script to build the update PostgreSQL file.

  • One driver for:

    • allpairs: johnson and Flowy-Warshall

    • Shortest path: Dijkstra and withPoints using Dijkstra

Deprecation of internal C/C++ functions

  • _pgr_drivingdistance(text,anyarray,double precision,boolean,boolean)

  • _pgr_kruskal(text,anyarray,text,bigint,double precision)

  • _pgr_prim(text,anyarray,text,bigint,double precision)

Internal C/C++ functions in legacy

  • _trsp(text,text,anyarray,anyarray,boolean)

  • _v4trsp(text,text,anyarray,anyarray,boolean)

  • _v4trsp(text,text,text,boolean)

  • _pgr_withpointsdd(text,text,anyarray,double precision,boolean,character,boolean,boolean)

All releases

Indices and tables