[pgrouting-dev] an implementation of beta skeletons, relative neighborhood graph and gabriel graphs

dave.potts at pinan.co.uk dave.potts at pinan.co.uk
Sat Mar 19 10:27:46 PDT 2016


Is there any interest in any off the above graph forms in the routing library? 

See 
https://en.wikipedia.org/wiki/Beta_skeleton
https://en.wikipedia.org/wiki/Relative_neighborhood_graph
https://en.wikipedia.org/wiki/Gabriel_graph

I have implementation with the following method signatures

CREATE OR REPLACE FUNCTION pgr_beta_skelton(sql text, beta float,OUT id integer ,OUT id1 integer , OUT id2 integer)
 RETURNS SETOF RECORD AS
 '$libdir/librouting-2.1', 'dir_graph_beta_skelton'
 LANGUAGE c STABLE STRICT;

CREATE OR REPLACE FUNCTION pgr_relative_neigborhood_graph(sql text ,OUT id integer ,OUT id1 integer , OUT id2 integer)
 RETURNS SETOF RECORD AS
 '$libdir/librouting-2.1', 'dir_graph_relative_neigborhood_graph'
 LANGUAGE c STABLE STRICT;

CREATE OR REPLACE FUNCTION pgr_gabriel_graph(sql text ,OUT id integer ,OUT id1 integer , OUT id2 integer)
 RETURNS SETOF RECORD AS
 '$libdir/librouting-2.1', 'dir_graph_gabriel_graph'
 LANGUAGE c STABLE STRICT;

They all take an sql statement of the form 

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;

Ie the expect an set of objects with an id and a x and y coordinate

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
eg
id | id1 | id2 
-----+-----+-----
 1 | 607 | 558
 2 | 606 | 542
 3 | 605 | 594
 4 | 605 | 520
 5 | 604 | 579
 6 | 604 | 525
 7 | 603 | 605
 8 | 603 | 594
 9 | 603 | 530
 10 | 602 | 580
 11 | 602 | 563
 12 | 601 | 537
 13 | 601 | 534
 14 | 600 | 523
 15 | 599 | 601
 16 | 599 | 522
 17 | 598 | 590
regards

Dave.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-dev/attachments/20160319/550c7c98/attachment.html>


More information about the pgrouting-dev mailing list