Skip to content

Third Party Resources and Writing functions

worthlutz edited this page Jul 8, 2016 · 10 revisions

pgRouting Gist code examples - list your pgRouting function(s), and share, discuss and improve them with others.

pl/pgsql

  • Add your Gist

  • TSP and ATSP functions, by Dave Potts. These functions provide some tools for solving Asymmetric TSP problems, utilities for building and check distance matrices.

  • pgr_analyzeGraph, modifications by cvvergara Modified pgr_analyzeGraph for handling schemas, also pgr_isColumnInTable and pgr_isColumnIndexed were modified to handle schemas.

  • TSP based on Dijkstra. This is an interesting post with example code I found on the web.

  • pgr_graphviz.sql is a function that will read an edge table and generate output suitable as input to graphviz that can generate graphical plots of your graph.

  • pgrw_xyroute.sql is an example of a wrapper around the pgr_trsp function to allow only x/y inputs for source and target points. Routing is then done by pgr_trsp using the nearest location on the closest edges to the source and target points. To achieve this result, the details of the specific routing network are hard-coded as constants in the wrapper. Modification to your specific situation should be simple.

Friends of pgRouting

This section list links to other sites that provide tools that work with pgRouting or provide enhancements to pgRouting that others have developed and are not part of the core product.

  • OSRM-Tools is a set of tools that allow you to connect pgRouting with the OSM routing engine. OSRM is a high performance routing engine that focuses on speed over configurability. OSRM-Tools provides tools to migrate data from pgRouting to OSRM (this tool is a little dated because OSRM does not supply a stable or documented API for this) and wrapper functions to access an OSRM route server from postgresql.

  • networkReach is a function using the core pgr_drivingDistance() function that will return all edges within a cost distance, along with partial edges where the cost goes beyond a node but not all the way to the next node.

Clone this wiki locally