Skip to content

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

@cvvergara

Description

@cvvergara
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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions