<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hello all.<br><br>I am working on what is going to be pgRouting v4.0 due at the end of 2023<br><br>Many ideas have come out from my experiments<br>From the internals simplifying (C/C++) code.<br><br>For usage:<br><br><b>pgr_TRSP</b><br><br>Currently it is a mess internally (C/C++) and externally.<br>Lets talk externally<br><br>Currently the documentation in one page has the following signatures:<br><br>pgr_trsp(sql text, source integer, target integer, directed boolean, has_rcost boolean [,restrict_sql text]);<br>RETURNS SETOF (seq, id1, id2, cost)<br><br>pgr_trsp(sql text, source_edge integer, source_pos float8, target_edge integer, target_pos float8,<br> directed boolean, has_rcost boolean [,restrict_sql text]);<br>RETURNS SETOF (seq, id1, id2, cost)<br><br>pgr_trspViaVertices(sql text, vids integer[], directed boolean, has_rcost boolean [, turn_restrict_sql text]);<br>RETURNS SETOF (seq, id1, id2, id3, cost)<br><br>pgr_trspViaEdges(sql text, eids integer[], pcts float8[], directed boolean, has_rcost boolean [, turn_restrict_sql text]);<br>RETURNS SETOF (seq, id1, id2, id3, cost)<br><br><br><b>Change those signatures</b><br><br>FROM:<br>pgr_trsp(sql text, source integer, target integer, directed boolean, has_rcost boolean [,restrict_sql text]);<br>RETURNS SETOF (seq, id1, id2, cost)<br><br>TO<br><br> driving_side CHAR DEFAULT 'b', -- 'r'/'l'/'b'/NULL<br> details BOOLEAN DEFAULT false,<br><br>pgr_trsp(Edges SQL, Restrictions sql, From vid, To vid [,directed]) -- one to one<br>pgr_trsp(Edges SQL, Restrictions sql, From vid, To vids [directed]) -- one to many<br>pgr_trsp(Edges SQL, Restrictions sql, From vids, To vid [,directed]) -- many to one<br>pgr_trsp(Edges SQL, Restrictions sql, From vids, To vids [,directed]) -- many to many<br>pgr_trsp(Edges SQL, Restrictions sql, Combinations SQL [,directed]) -- combinations<br>RETURNS SET OF (seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)<br><br>Note that regardless of the call all columns are returned<br><br>FROM:<br>pgr_trsp(sql text, source_edge integer, source_pos float8, target_edge integer, target_pos float8,<br> directed boolean, has_rcost boolean [,restrict_sql text]);<br>RETURNS SETOF (seq, id1, id2, cost)<br><br>TO<br><br>pgr_trsp_withPoints(Edges SQL, Restrictions sql, Points SQL, From vid, To vid [,directed][,driving_side][,details]) -- one to one<br>pgr_trsp_withPoints(Edges SQL, Restrictions sql, Points SQL, >From vid, To vids [,directed][,driving_side][,details]) -- one to many<br>pgr_trsp_withPoints(Edges SQL, Restrictions sql, Points SQL, From vids, To vid [,directed][,driving_side][,details]) -- many to one<br>pgr_trsp_withPoints(Edges SQL, Restrictions sql, Points SQL, From vids, To vids [,directed][,driving_side][,details]) -- many to many<br>pgr_trsp_withPoints(Edges SQL, Restrictions sql, Points SQL, Combinations SQL [,directed][,driving_side][,details]) -- combinations<br>RETURNS SET OF (seq, path_seq, start_pid, end_pid, node, edge, cost, agg_cost)<br><br>Note: that regardless of the call all columns are returned<br><br><br><br>FROM:<br>pgr_trspViaVertices(sql text, vids integer[], directed boolean, has_rcost boolean [, turn_restrict_sql text]);<br>RETURNS SETOF (seq, id1, id2, id3, cost)<br><br>TO<br>pgr_trspVia(Edges SQL, Restrictions sql, Via Array, [,directed][,strict][,allow_u_turn])<br>RETURNS SET OF (seq, path_id, path_seq, start_pid, end_pid, node, edge, cost, agg_cost)<br><br><br><br>FROM:<br>pgr_trspViaEdges(sql text, eids integer[], pcts float8[], directed boolean, has_rcost boolean [, turn_restrict_sql text]);<br>RETURNS SETOF (seq, id1, id2, id3, cost)<br><br>TO<br><br>pgr_trsp_withPointsVia(Edges SQL, Restrictions sql, Points SQL, Via Array [,directed][,driving_side][,details][,strict][,allow_u_turn])<br>RETURNS SET OF (seq, path_id, path_seq, start_pid, end_pid, node, edge, cost, agg_cost)<br><br>Note that regardless of the call all columns are returned<br><br><br><b>About Via functions</b><br><br>pgr_dijkstraVia(Edges SQL, Via Array [,directed][,driving_side][,details][,strict][,allow_u_turn])<br>pgr_withPointsVia(Edges SQL, Points SQL, Via Array [,directed][,driving_side][,details][,strict][,allow_u_turn])<br>pgr_trsp_withPointsVia(Edges SQL, Restrictions sql, Points SQL, Via Array [,directed][,driving_side][,details][,strict][,allow_u_turn])<br>RETURNS SET OF (seq, path_id, path_seq, start_pid, end_pid, node, edge, cost, agg_cost)<br><br>Note: that regardless of the call the same columns are returned<br>Note: currently only pgr_dijkstraVia exist<br><br><b>About unifying return columns</b><br><br>For example on dijkstra<br>pgr_dijkstra(Edges SQL, start_vid, end_vid [, directed])<br>pgr_dijkstra(Edges SQL, start_vid, end_vids [, directed])<br>pgr_dijkstra(Edges SQL, start_vids, end_vid [, directed])<br>pgr_dijkstra(Edges SQL, start_vids, end_vids [, directed])<br>pgr_dijkstra(Edges SQL, Combinations SQL [, directed])<br>RETURNS SET OF (seq, path_seq [, start_vid] [, end_vid], node, edge, cost, agg_cost)<br><br>Depending on the call, are the columns returned<br><br>Change to<br>RETURNS SET OF (seq, path_seq , start_vid, end_vid, node, edge, cost, agg_cost)<br><br>That way regardless of the call the same columns are returned<br><br>That unification of many other official, proposed and experimental functions like pgr_astar, pgr_bdAstar etc.<br><br>Having for the same (family) calls the same returned columns, makes it easier to remember, aka less complicated API<br><br><b>About naming because of withPoints</b>.<br><br>Currently there are the following proposed functions and they all work with dijkstra<br><br>* pgr_withPoints<br>* pgr_withPointsCost<br>* pgr_withPointsCostMatrix<br>* pgr_withPointsKSP<br>* pgr_withPointsDD<br>* pgr_withPointsVia -- to be done<br><br>Thinking about trsp (for when they are developed):<br><br>* pgr_trsp_withPoints<br>* pgr_trsp_withPointsCost<br>* pgr_trsp_withPointsCostMatrix<br>* pgr_trsp_withPointsKSP<br>* pgr_trsp_withPointsDD<br>* pgr_trsp_withPointsVia<br><br>Thinking about aStar (for when they are developed):<br><br>* pgr_aStar_withPoints<br>* pgr_aStar_withPointsCost<br>* pgr_aStar_withPointsCostMatrix<br>* pgr_aStar_withPointsKSP<br>* pgr_aStar_withPointsDD<br>* pgr_aStar_withPointsVia<br><br><br>Having this convention when with points are involved, makes it easier to remember, aka less complicated API</div><div><br></div><div><br></div><div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">I would like your thoughts</div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">Regards<br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">Vicky</div><br></div>-- <br><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><pre>Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44,
81739 München, Germany
Vicky Vergara
Operations Research
eMail: vicky@<a href="http://georepublic.de" target="_blank">georepublic.de</a>
Web: <a href="https://georepublic.info" target="_blank">https://georepublic.info</a>
Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9
Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl
<span></span></pre></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>