<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><div data-html-editor-font-wrapper="true" style="font-family: arial, sans-serif; font-size: 13px;">Is there any interest in any off the above graph forms in the routing library? <br><br>See <br>https://en.wikipedia.org/wiki/Beta_skeleton<br>https://en.wikipedia.org/wiki/Relative_neighborhood_graph<br>https://en.wikipedia.org/wiki/Gabriel_graph<br><br>I have implementation with the following method signatures<br><br>CREATE OR REPLACE FUNCTION pgr_beta_skelton(sql text, beta float,OUT id integer ,OUT id1 integer , OUT id2 integer)<br> RETURNS SETOF RECORD AS<br> '$libdir/librouting-2.1', 'dir_graph_beta_skelton'<br> LANGUAGE c STABLE STRICT;<br><br>CREATE OR REPLACE FUNCTION pgr_relative_neigborhood_graph(sql text ,OUT id integer ,OUT id1 integer , OUT id2 integer)<br> RETURNS SETOF RECORD AS<br> '$libdir/librouting-2.1', 'dir_graph_relative_neigborhood_graph'<br> LANGUAGE c STABLE STRICT;<br><br>CREATE OR REPLACE FUNCTION pgr_gabriel_graph(sql text ,OUT id integer ,OUT id1 integer , OUT id2 integer)<br> RETURNS SETOF RECORD AS<br> '$libdir/librouting-2.1', 'dir_graph_gabriel_graph'<br> LANGUAGE c STABLE STRICT;<br><br>They all take an sql statement of the form <br><br>select st_makeline(v1.the_geom,v2.the_geom) as the_geom from pgr_gabriel_graph('select id,st_x(the_geom) as x ,st_y(the_geom) as y from tmp_table2'), tmp_table2 v1, tmp_table2 v2 where id1=v1.id and id2=v2.id;<br><br>Ie the expect an set of objects with an id and a x and y coordinate<br><br>In this example tmp_table functions as resource of data, and the above statement returns a serries of id statements id refers to id of 1st x/y node and the 2nd id refers to 2md x/y pair<br>eg<br>id | id1 | id2 <br>-----+-----+-----<br> 1 | 607 | 558<br> 2 | 606 | 542<br> 3 | 605 | 594<br> 4 | 605 | 520<br> 5 | 604 | 579<br> 6 | 604 | 525<br> 7 | 603 | 605<br> 8 | 603 | 594<br> 9 | 603 | 530<br> 10 | 602 | 580<br> 11 | 602 | 563<br> 12 | 601 | 537<br> 13 | 601 | 534<br> 14 | 600 | 523<br> 15 | 599 | 601<br> 16 | 599 | 522<br> 17 | 598 | 590<br><br><br>regards<br><br>Dave.<br><br> </div></body></html>