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

withPoints X #300

Closed
cvvergara opened this issue Jun 12, 2023 · 5 comments
Closed

withPoints X #300

cvvergara opened this issue Jun 12, 2023 · 5 comments

Comments

@cvvergara
Copy link
Member

pgr_withPointsDD(Edges SQL, Points SQL, root vid, distance, [options A])
options A: [directed, driving_side, details]

become

pgr_withPointsDD([Edges SQL, Points SQL, root vid, distance, driving side, [options A])
options A: [directed,  details]

"Both" is only valid on undirected graphs

@krashish8
Copy link
Member

What if the graph is undirected and the end pgRouting user gave 'b' driving_side? Shall we raise an SQL error in that case?

Also, what will shall be the default value of driving side - same as before ('b') or are we changing it to 'r' for 3.6 onwards?

@squarege
Copy link
Contributor

squarege commented Jul 14, 2023

Confusion:

In the change @cvvergara do here, in fact, [r,l,b] all treated as b on undirected graphs, and b is still valid on directed graphs. It's different from what we discussed before in which "Both" is only valid on undirected graphs.

Should I throw an error when b is given on directed graphs?

@cvvergara
Copy link
Member Author

@squarege
Copy link
Contributor

Summary of the discussion in Gitter

When thinking of vehicles:

  • There are countries with left side driving, like India, UK
  • There are countries with right side driving, like Mexico, China
  • No country has both sides driving
  • Directed graph is used to represent streets for vehicles

When thinking of pedestrians:

  • They can go in both directions in any case.
  • driving side is meaningless for pedestrians.
  • Undirected graph used to represent sidewalks.

Q: What would be the best default value of "driving side" for vehicles
A: r as default for vehicles, reasons:

  • Most of app are for vehicles, and can only choose between r & l.
  • Most of countries are right side driving.
  • So r is more suitable for most cases.

@cvvergara
Copy link
Member Author

So vehicles is 'R', 'L', 'r', 'l'
Therefore directed graphs is 'R', 'L', 'r', 'l'
But, who knows... for "routing" application that is what makes sense
but pgRouting is about graphs
and maybe, it is been used to throw cables for electircity and many unknown application that we as developers of the back end can not think.
So, for the moment, lets keep directed graphs valid values to be: 'R', 'L', 'r', 'l'
we will need to think what 'both' really would mean in a directed graph
For pedestrians
aka is undirected graph
is Right and left driving side would be walking side, does not matter
so 'Both' is when it makes sense
Because it is no loger default:
pseudocode

if graph is directed then valid values are  'R', 'L', 'r', 'l', 
else valid values 'B', 'b'

There is no default value, so do not change the value given by the user
of course this applies to the C function you are creating
Do not change the old logic on the old function, aka the one that is going to be deleted on v4
Later on we will see if 'B' and 'b' is also ok on directed graph, and what that value be interpreted as.
Or if 'R', 'L', 'r', 'l', be added to undirected graph.
but for the moment keep the

if graph is directed then valid values are  'R', 'L', 'r', 'l', 
else valid values 'B', 'b'

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

No branches or pull requests

3 participants