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

When point is a vertex, the withPoints family do not return results #2689

Closed
cvvergara opened this issue Dec 14, 2024 · 0 comments · Fixed by #2691
Closed

When point is a vertex, the withPoints family do not return results #2689

cvvergara opened this issue Dec 14, 2024 · 0 comments · Fixed by #2691
Assignees
Milestone

Comments

@cvvergara
Copy link
Member

CREATE VIEW four_edges AS 
SELECT * FROM edges WHERE id IN (1, 4, 10, 14); 

Using the sample data of the documentation
Setting the point to be on vertex 7 (aka the source of edge 10):

7 (p) --------> 8 ---------------> 9

Query:

SELECT * FROM pgr_withPoints(
  $$SELECT id, source, target, cost, reverse_cost FROM four_edges$$, 
   $$SELECT 10 AS edge_id, 0::float AS fraction $$,
  -1, 9, true);

Results:

 seq | path_seq | node | edge | cost | agg_cost 
-----+----------+------+------+------+----------
(0 rows)

Expected results:

 seq | path_seq | node | edge | cost | agg_cost 
-----+----------+------+------+------+----------
   1 |        1 |   -1 |   10 |    1 |        0
   2 |        2 |    8 |   14 |    1 |        1
   3 |        3 |    9 |   -1 |    0 |        2
(3 rows)

Similar situation happens with all the withPoints functions:

  • pgr_withPointsKSP
  • pgr_trspVia_withPoints
  • pgr_withPoints
  • pgr_withPointsCost
  • pgr_withPointsCostMatrix
  • pgr_withPointsDD
  • pgr_withPointsVia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant