Skip to content

pgr_withPointsDD return wrong cost when details:=false  #979

@apslight

Description

@apslight

QUERY

'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
'SELECT pid, edge_id, fraction, side from pointsOfInterest',
-1, 3.8, driving_side := 'b', details := false);

Driving distance starting from point -1 which is the little house one the left side of edge 1 and only for 3.8 units far away.

Output (when details:=false)

seq node edge cost agg_cost
1 -1 -1 0 0
2 1 1 0.4 0.4
3 2 1 0.6 0.6
4 5 4 0.3 1.6
5 6 8 1 2.6
6 8 7 1 2.6
7 10 10 1 2.6
8 7 6 0.3 3.6
9 9 9 1 3.6
10 11 11 1 3.6
11 13 14 1 3.6

details:=false which ignores other points of the points_sql.
Actual Behaviour : in 4th row the cost of travelling edge 4 is 0.3
Expected behaviour: But instead of 0.3 it should be 1 which is actual cost of travelling of edge 4.

QUERY (when details:= true)

'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
'SELECT pid, edge_id, fraction, side from pointsOfInterest',
-1, 3.8, driving_side := 'b', details := true);

Output (when details:= true)

seq node edge cost agg_cost
1 -1 -1 0 0
2 1 1 0.4 0.4
3 2 1 0.6 0.6
4 -6 4 0.7 1.3
5 5 4 0.3 1.6
6 6 8 1 2.6
7 8 7 1 2.6
8 10 10 1 2.6
9 -7 9 0.5 3.1
10 -3 12 0.6 3.2
11 -4 6 0.7 3.3
12 7 6 0.3 3.6
13 9 9 0.5 3.6
14 11 11 1 3.6
15 13 14 1 3.6

when details:=true then it is coming correct.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions