Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgr_trsp for version 3.4 #2238

Closed
4 tasks done
cvvergara opened this issue Jan 19, 2022 Discussed in #2222 · 2 comments
Closed
4 tasks done

pgr_trsp for version 3.4 #2238

cvvergara opened this issue Jan 19, 2022 Discussed in #2222 · 2 comments
Labels
Milestone

Comments

@cvvergara
Copy link
Member

cvvergara commented Jan 19, 2022

Discussed in #2222

Originally posted by cvvergara December 16, 2021

pgr_trsp

Currently it is a mess internally (C/C++) and externally.
Lets talk externally

Currently the documentation in one page has the following signatures:

pgr_trsp(sql text, source integer, target integer, directed boolean, has_rcost boolean [,restrict_sql text]);
RETURNS SETOF (seq, id1, id2, cost)

pgr_trsp(sql text, source_edge integer, source_pos float8, target_edge integer, target_pos float8,
                  directed boolean, has_rcost boolean [,restrict_sql text]);
RETURNS SETOF (seq, id1, id2, cost)

pgr_trspViaVertices(sql text, vids integer[], directed boolean, has_rcost boolean [, turn_restrict_sql text]);
RETURNS SETOF (seq, id1, id2, id3, cost)

pgr_trspViaEdges(sql text, eids integer[], pcts float8[], directed boolean, has_rcost boolean [, turn_restrict_sql text]);
RETURNS SETOF (seq, id1, id2, id3, cost)

Change those signatures

FROM:

pgr_trsp(sql text, source integer, target integer, directed boolean, has_rcost boolean [,restrict_sql text]);
RETURNS SETOF (seq, id1, id2, cost)

TO

pgr_trsp(Edges SQL, Restrictions sql, From vid, To vid [,directed]) -- one to one
pgr_trsp(Edges SQL, Restrictions sql, From vid, To vids [directed]) -- one to many
pgr_trsp(Edges SQL, Restrictions sql, From vids, To vid [,directed]) -- many to one
pgr_trsp(Edges SQL, Restrictions sql, From vids, To vids [,directed]) -- many to many
pgr_trsp(Edges SQL, Restrictions sql, Combinations SQL [,directed]) -- combinations
RETURNS SET OF (seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)

Note that regardless of the call all columns are returned

FROM:

pgr_trsp(sql text, source_edge integer, source_pos float8, target_edge integer, target_pos float8,
                  directed boolean, has_rcost boolean [,restrict_sql text]);
RETURNS SETOF (seq, id1, id2, cost)

TO

pgr_trsp_withPoints(Edges SQL, Restrictions sql, Points SQL, From vid, To vid [,directed][,driving_side][,details]) -- one to one
pgr_trsp_withPoints(Edges SQL, Restrictions sql, Points SQL, From vid, To vids [,directed][,driving_side][,details]) -- one to many
pgr_trsp_withPoints(Edges SQL, Restrictions sql, Points SQL, From vids, To vid [,directed][,driving_side][,details]) -- many to one
pgr_trsp_withPoints(Edges SQL, Restrictions sql, Points SQL, From vids, To vids [,directed][,driving_side][,details]) -- many to many
pgr_trsp_withPoints(Edges SQL, Restrictions sql, Points SQL, Combinations SQL [,directed][,driving_side][,details]) -- combinations
RETURNS SET OF (seq, path_seq, start_pid, end_pid, node, edge, cost, agg_cost)

Note: that regardless of the call all columns are returned

FROM:

pgr_trspViaVertices(sql text, vids integer[], directed boolean, has_rcost boolean [, turn_restrict_sql text]);
RETURNS SETOF (seq, id1, id2, id3, cost)

TO

pgr_trspVia(Edges SQL, Restrictions sql, Via Array,  [,directed][,strict][,allow_u_turn])
RETURNS SET OF (seq, path_id, path_seq, start_pid, end_pid, node, edge, cost, agg_cost)

FROM:

pgr_trspViaEdges(sql text, eids integer[], pcts float8[], directed boolean, has_rcost boolean [, turn_restrict_sql text]);
RETURNS SETOF (seq, id1, id2, id3, cost)

TO

pgr_trsp_withPointsVia(Edges SQL, Restrictions sql, Points SQL, Via Array [,directed][,driving_side][,details][,strict][,allow_u_turn])
RETURNS SET OF (seq, path_id, path_seq, start_pid, end_pid, node, edge, cost, agg_cost)

TODO

@cvvergara
Copy link
Member Author

cvvergara commented Feb 16, 2022

In order to have the set of functions that will substitute pgr_trsp_withPointsVia it is also needed

@cvvergara
Copy link
Member Author

Basically all the tasks are done. What might be missing is a full review of the documentation of the whole functions as a set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant