Skip to content

Instantly share code, notes, and snippets.

View sukhjitsehra's full-sized avatar

Sehra, Sukhjit Singh sukhjitsehra

View GitHub Profile
@sukhjitsehra
sukhjitsehra / pgr_graphviz.sql
Created July 25, 2016 17:39 — forked from woodbri/pgr_graphviz.sql
Here is a stored procedure that can be user to create a GraphViz input file from a pgRouting edge table. It create a text output that can be copied to myfile.gv, then can be converted to an image using ``neato -Tpng -O myfile.gv`` and the image will be in ``myfile.gv.png``.
create or replace function pgr_graphviz(edge_table text,
eid text default 'id',
source text default 'source',
target text default 'target',
oneway text default '',
ft text[] default array['FT']::text[],
tf text[] default array['TF']::text[],
where_clause text default 'true',
nodepos bool default false)
returns text as