diff --git a/doc/withPoints/pgr_withPointsKSP.rst b/doc/withPoints/pgr_withPointsKSP.rst index d7b640e90e..123ca2f8a7 100644 --- a/doc/withPoints/pgr_withPointsKSP.rst +++ b/doc/withPoints/pgr_withPointsKSP.rst @@ -94,7 +94,7 @@ One to One * No details are given about distance of other points of the query. * No heap paths are returned. -.. literalinclude:: doc-pgr_withPointsKSP.queries +.. literalinclude:: withPointsKSP.queries :start-after: --q1 :end-before: --q2 @@ -116,7 +116,7 @@ One to Many :Example: Get 2 paths from point :math:`1` to point :math:`3` and vertex :math:`7` on an undirected graph -.. literalinclude:: doc-pgr_withPointsKSP.queries +.. literalinclude:: withPointsKSP.queries :start-after: --q2 :end-before: --q3 @@ -138,7 +138,7 @@ Many to One :Example: Get a path from point :math:`1` and vertex :math:`6` to point :math:`3` on a **directed** graph with **right** side driving and **details** set to **True** -.. literalinclude:: doc-pgr_withPointsKSP.queries +.. literalinclude:: withPointsKSP.queries :start-after: --q3 :end-before: --q4 @@ -160,7 +160,7 @@ Many to Many :Example: Get a path from point :math:`1` and vertex :math:`6` to point :math:`3` and vertex :math:`1` on a **directed** graph with **left** side driving and **heap_paths** set to **True** -.. literalinclude:: doc-pgr_withPointsKSP.queries +.. literalinclude:: withPointsKSP.queries :start-after: --q4 :end-before: --q5 @@ -181,7 +181,7 @@ Combinations :Example: Using a combinations table on an **directed** graph -.. literalinclude:: doc-pgr_withPointsKSP.queries +.. literalinclude:: withPointsKSP.queries :start-after: --q5 :end-before: --q6 @@ -303,7 +303,7 @@ Use :doc:`pgr_findCloseEdges` in the `Points SQL`_. Get :math:`2` paths using left side driving topology, from vertex :math:`1` to the closest location on the graph of point `(2.9, 1.8)`. -.. literalinclude:: doc-pgr_withPointsKSP.queries +.. literalinclude:: withPointsKSP.queries :start-after: --q6 :end-before: --q7 @@ -315,7 +315,7 @@ Left driving side Get :math:`2` paths using left side driving topology, from point :math:`1` to point :math:`3` with details. -.. literalinclude:: doc-pgr_withPointsKSP.queries +.. literalinclude:: withPointsKSP.queries :start-after: --q7 :end-before: --q8 @@ -325,7 +325,7 @@ Right driving side Get :math:`2` paths using right side driving topology from, point :math:`1` to point :math:`2` with heap paths and details. -.. literalinclude:: doc-pgr_withPointsKSP.queries +.. literalinclude:: withPointsKSP.queries :start-after: --q8 :end-before: --q9 diff --git a/docqueries/withPoints/doc-pgr_withPointsKSP.result b/docqueries/withPoints/doc-pgr_withPointsKSP.result index 7b5c6ec5a5..ef39d475c3 100644 --- a/docqueries/withPoints/doc-pgr_withPointsKSP.result +++ b/docqueries/withPoints/doc-pgr_withPointsKSP.result @@ -8,137 +8,93 @@ SET SELECT * FROM pgr_withPointsKSP( 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - -1, -2, 2, 'l'); - seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+---------+----------+-----------+---------+------+------+------+---------- - 1 | 1 | 1 | -1 | -2 | -1 | 1 | 0.6 | 0 - 2 | 1 | 2 | -1 | -2 | 6 | 4 | 1 | 0.6 - 3 | 1 | 3 | -1 | -2 | 7 | 8 | 1 | 1.6 - 4 | 1 | 4 | -1 | -2 | 11 | 11 | 1 | 2.6 - 5 | 1 | 5 | -1 | -2 | 12 | 13 | 1 | 3.6 - 6 | 1 | 6 | -1 | -2 | 17 | 15 | 0.6 | 4.6 - 7 | 1 | 7 | -1 | -2 | -2 | -1 | 0 | 5.2 - 8 | 2 | 1 | -1 | -2 | -1 | 1 | 0.6 | 0 - 9 | 2 | 2 | -1 | -2 | 6 | 4 | 1 | 0.6 - 10 | 2 | 3 | -1 | -2 | 7 | 8 | 1 | 1.6 - 11 | 2 | 4 | -1 | -2 | 11 | 9 | 1 | 2.6 - 12 | 2 | 5 | -1 | -2 | 16 | 15 | 1.6 | 3.6 - 13 | 2 | 6 | -1 | -2 | -2 | -1 | 0 | 5.2 + -1, -2, 2); +WARNING: pgr_withPointsKSP(text,text,bigint,bigint,integer,boolean,boolean,char,boolean) deprecated on v3.6.0 + seq | path_id | path_seq | node | edge | cost | agg_cost +-----+---------+----------+------+------+------+---------- + 1 | 1 | 1 | -1 | 1 | 0.6 | 0 + 2 | 1 | 2 | 6 | 4 | 1 | 0.6 + 3 | 1 | 3 | 7 | 8 | 1 | 1.6 + 4 | 1 | 4 | 11 | 9 | 1 | 2.6 + 5 | 1 | 5 | 16 | 15 | 0.4 | 3.6 + 6 | 1 | 6 | -2 | -1 | 0 | 4 + 7 | 2 | 1 | -1 | 1 | 0.6 | 0 + 8 | 2 | 2 | 6 | 4 | 1 | 0.6 + 9 | 2 | 3 | 7 | 8 | 1 | 1.6 + 10 | 2 | 4 | 11 | 11 | 1 | 2.6 + 11 | 2 | 5 | 12 | 13 | 1 | 3.6 + 12 | 2 | 6 | 17 | 15 | 0.6 | 4.6 + 13 | 2 | 7 | -2 | -1 | 0 | 5.2 (13 rows) /* --q2 */ SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - -1, ARRAY[-3, 7], 2, 'B', - directed => false); - seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+---------+----------+-----------+---------+------+------+------+---------- - 1 | 1 | 1 | -1 | -3 | -1 | 1 | 0.6 | 0 - 2 | 1 | 2 | -1 | -3 | 6 | 4 | 1 | 0.6 - 3 | 1 | 3 | -1 | -3 | 7 | 10 | 1 | 1.6 - 4 | 1 | 4 | -1 | -3 | 8 | 12 | 0.6 | 2.6 - 5 | 1 | 5 | -1 | -3 | -3 | -1 | 0 | 3.2 - 6 | 2 | 1 | -1 | -3 | -1 | 1 | 0.6 | 0 - 7 | 2 | 2 | -1 | -3 | 6 | 4 | 1 | 0.6 - 8 | 2 | 3 | -1 | -3 | 7 | 8 | 1 | 1.6 - 9 | 2 | 4 | -1 | -3 | 11 | 11 | 1 | 2.6 - 10 | 2 | 5 | -1 | -3 | 12 | 12 | 0.4 | 3.6 - 11 | 2 | 6 | -1 | -3 | -3 | -1 | 0 | 4 - 12 | 3 | 1 | -1 | 7 | -1 | 1 | 0.6 | 0 - 13 | 3 | 2 | -1 | 7 | 6 | 4 | 1 | 0.6 - 14 | 3 | 3 | -1 | 7 | 7 | -1 | 0 | 1.6 - 15 | 4 | 1 | -1 | 7 | -1 | 1 | 0.6 | 0 - 16 | 4 | 2 | -1 | 7 | 6 | 2 | 1 | 0.6 - 17 | 4 | 3 | -1 | 7 | 10 | 5 | 1 | 1.6 - 18 | 4 | 4 | -1 | 7 | 11 | 8 | 1 | 2.6 - 19 | 4 | 5 | -1 | 7 | 7 | -1 | 0 | 3.6 -(19 rows) + 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', + 'SELECT pid, edge_id, fraction, side from pointsOfInterest', + -1, -2, 2, + driving_side := 'l', details := true); +WARNING: pgr_withPointsKSP(text,text,bigint,bigint,integer,boolean,boolean,char,boolean) deprecated on v3.6.0 + seq | path_id | path_seq | node | edge | cost | agg_cost +-----+---------+----------+------+------+------+---------- + 1 | 1 | 1 | -1 | 1 | 0.6 | 0 + 2 | 1 | 2 | 6 | 4 | 0.7 | 0.6 + 3 | 1 | 3 | -6 | 4 | 0.3 | 1.3 + 4 | 1 | 4 | 7 | 8 | 1 | 1.6 + 5 | 1 | 5 | 11 | 11 | 1 | 2.6 + 6 | 1 | 6 | 12 | 13 | 1 | 3.6 + 7 | 1 | 7 | 17 | 15 | 0.6 | 4.6 + 8 | 1 | 8 | -2 | -1 | 0 | 5.2 + 9 | 2 | 1 | -1 | 1 | 0.6 | 0 + 10 | 2 | 2 | 6 | 4 | 0.7 | 0.6 + 11 | 2 | 3 | -6 | 4 | 0.3 | 1.3 + 12 | 2 | 4 | 7 | 8 | 1 | 1.6 + 13 | 2 | 5 | 11 | 9 | 1 | 2.6 + 14 | 2 | 6 | 16 | 15 | 1 | 3.6 + 15 | 2 | 7 | 17 | 15 | 0.6 | 4.6 + 16 | 2 | 8 | -2 | -1 | 0 | 5.2 +(16 rows) /* --q3 */ SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - ARRAY[-1, 6], -3, 1,'r', details:= true); - seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+---------+----------+-----------+---------+------+------+------+---------- - 1 | 1 | 1 | -1 | -3 | -1 | 1 | 0.4 | 0 - 2 | 1 | 2 | -1 | -3 | 5 | 1 | 1 | 0.4 - 3 | 1 | 3 | -1 | -3 | 6 | 4 | 0.7 | 1.4 - 4 | 1 | 4 | -1 | -3 | -6 | 4 | 0.3 | 2.1 - 5 | 1 | 5 | -1 | -3 | 7 | 10 | 1 | 2.4 - 6 | 1 | 6 | -1 | -3 | 8 | 12 | 0.6 | 3.4 - 7 | 1 | 7 | -1 | -3 | -3 | -1 | 0 | 4 - 8 | 2 | 1 | 6 | -3 | 6 | 4 | 0.7 | 0 - 9 | 2 | 2 | 6 | -3 | -6 | 4 | 0.3 | 0.7 - 10 | 2 | 3 | 6 | -3 | 7 | 10 | 1 | 1 - 11 | 2 | 4 | 6 | -3 | 8 | 12 | 0.6 | 2 - 12 | 2 | 5 | 6 | -3 | -3 | -1 | 0 | 2.6 -(12 rows) + 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', + 'SELECT pid, edge_id, fraction, side from pointsOfInterest', + -1, -2, 2, + heap_paths := true, driving_side := 'r', details := true); +WARNING: pgr_withPointsKSP(text,text,bigint,bigint,integer,boolean,boolean,char,boolean) deprecated on v3.6.0 + seq | path_id | path_seq | node | edge | cost | agg_cost +-----+---------+----------+------+------+------+---------- + 1 | 1 | 1 | -1 | 1 | 0.4 | 0 + 2 | 1 | 2 | 5 | 1 | 1 | 0.4 + 3 | 1 | 3 | 6 | 4 | 0.7 | 1.4 + 4 | 1 | 4 | -6 | 4 | 0.3 | 2.1 + 5 | 1 | 5 | 7 | 8 | 1 | 2.4 + 6 | 1 | 6 | 11 | 9 | 1 | 3.4 + 7 | 1 | 7 | 16 | 15 | 0.4 | 4.4 + 8 | 1 | 8 | -2 | -1 | 0 | 4.8 + 9 | 2 | 1 | -1 | 1 | 0.4 | 0 + 10 | 2 | 2 | 5 | 1 | 1 | 0.4 + 11 | 2 | 3 | 6 | 4 | 0.7 | 1.4 + 12 | 2 | 4 | -6 | 4 | 0.3 | 2.1 + 13 | 2 | 5 | 7 | 8 | 1 | 2.4 + 14 | 2 | 6 | 11 | 11 | 1 | 3.4 + 15 | 2 | 7 | 12 | 13 | 1 | 4.4 + 16 | 2 | 8 | 17 | 15 | 1 | 5.4 + 17 | 2 | 9 | 16 | 15 | 0.4 | 6.4 + 18 | 2 | 10 | -2 | -1 | 0 | 6.8 + 19 | 3 | 1 | -1 | 1 | 0.4 | 0 + 20 | 3 | 2 | 5 | 1 | 1 | 0.4 + 21 | 3 | 3 | 6 | 4 | 0.7 | 1.4 + 22 | 3 | 4 | -6 | 4 | 0.3 | 2.1 + 23 | 3 | 5 | 7 | 10 | 1 | 2.4 + 24 | 3 | 6 | 8 | 12 | 0.6 | 3.4 + 25 | 3 | 7 | -3 | 12 | 0.4 | 4 + 26 | 3 | 8 | 12 | 13 | 1 | 4.4 + 27 | 3 | 9 | 17 | 15 | 1 | 5.4 + 28 | 3 | 10 | 16 | 15 | 0.4 | 6.4 + 29 | 3 | 11 | -2 | -1 | 0 | 6.8 +(29 rows) /* --q4 */ -SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - ARRAY[-1, 6], ARRAY[-3, 1], 1, 'l', heap_paths:= true); - seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+---------+----------+-----------+---------+------+------+------+---------- - 1 | 1 | 1 | -1 | -3 | -1 | 1 | 0.6 | 0 - 2 | 1 | 2 | -1 | -3 | 6 | 4 | 1 | 0.6 - 3 | 1 | 3 | -1 | -3 | 7 | 10 | 1 | 1.6 - 4 | 1 | 4 | -1 | -3 | 8 | 12 | 0.6 | 2.6 - 5 | 1 | 5 | -1 | -3 | -3 | -1 | 0 | 3.2 - 6 | 2 | 1 | -1 | 1 | -1 | 1 | 0.6 | 0 - 7 | 2 | 2 | -1 | 1 | 6 | 4 | 1 | 0.6 - 8 | 2 | 3 | -1 | 1 | 7 | 7 | 1 | 1.6 - 9 | 2 | 4 | -1 | 1 | 3 | 6 | 1 | 2.6 - 10 | 2 | 5 | -1 | 1 | 1 | -1 | 0 | 3.6 - 11 | 3 | 1 | 6 | -3 | 6 | 4 | 1 | 0 - 12 | 3 | 2 | 6 | -3 | 7 | 10 | 1 | 1 - 13 | 3 | 3 | 6 | -3 | 8 | 12 | 0.6 | 2 - 14 | 3 | 4 | 6 | -3 | -3 | -1 | 0 | 2.6 - 15 | 4 | 1 | 6 | 1 | 6 | 4 | 1 | 0 - 16 | 4 | 2 | 6 | 1 | 7 | 7 | 1 | 1 - 17 | 4 | 3 | 6 | 1 | 3 | 6 | 1 | 2 - 18 | 4 | 4 | 6 | 1 | 1 | -1 | 0 | 3 -(18 rows) - -/* --q5 */ -SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - 'SELECT * FROM (VALUES (-1, 10), (6, -3)) AS combinations(source, target)', - 2, 'r', details => true); - seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+---------+----------+-----------+---------+------+------+------+---------- - 1 | 1 | 1 | -1 | 10 | -1 | 1 | 0.4 | 0 - 2 | 1 | 2 | -1 | 10 | 5 | 1 | 1 | 0.4 - 3 | 1 | 3 | -1 | 10 | 6 | 4 | 0.7 | 1.4 - 4 | 1 | 4 | -1 | 10 | -6 | 4 | 0.3 | 2.1 - 5 | 1 | 5 | -1 | 10 | 7 | 8 | 1 | 2.4 - 6 | 1 | 6 | -1 | 10 | 11 | 9 | 1 | 3.4 - 7 | 1 | 7 | -1 | 10 | 16 | 16 | 1 | 4.4 - 8 | 1 | 8 | -1 | 10 | 15 | 3 | 1 | 5.4 - 9 | 1 | 9 | -1 | 10 | 10 | -1 | 0 | 6.4 - 10 | 2 | 1 | -1 | 10 | -1 | 1 | 0.4 | 0 - 11 | 2 | 2 | -1 | 10 | 5 | 1 | 1 | 0.4 - 12 | 2 | 3 | -1 | 10 | 6 | 4 | 0.7 | 1.4 - 13 | 2 | 4 | -1 | 10 | -6 | 4 | 0.3 | 2.1 - 14 | 2 | 5 | -1 | 10 | 7 | 8 | 1 | 2.4 - 15 | 2 | 6 | -1 | 10 | 11 | 11 | 1 | 3.4 - 16 | 2 | 7 | -1 | 10 | 12 | 13 | 1 | 4.4 - 17 | 2 | 8 | -1 | 10 | 17 | 15 | 1 | 5.4 - 18 | 2 | 9 | -1 | 10 | 16 | 16 | 1 | 6.4 - 19 | 2 | 10 | -1 | 10 | 15 | 3 | 1 | 7.4 - 20 | 2 | 11 | -1 | 10 | 10 | -1 | 0 | 8.4 - 21 | 3 | 1 | 6 | -3 | 6 | 4 | 0.7 | 0 - 22 | 3 | 2 | 6 | -3 | -6 | 4 | 0.3 | 0.7 - 23 | 3 | 3 | 6 | -3 | 7 | 10 | 1 | 1 - 24 | 3 | 4 | 6 | -3 | 8 | 12 | 0.6 | 2 - 25 | 3 | 5 | 6 | -3 | -3 | -1 | 0 | 2.6 -(25 rows) - -/* --q6 */ SELECT * FROM pgr_withPointsKSP( $e$ SELECT * FROM edges $e$, $p$ SELECT edge_id, round(fraction::numeric, 2) AS fraction, side @@ -147,83 +103,31 @@ SELECT * FROM pgr_withPointsKSP( (SELECT ST_POINT(2.9, 1.8)), 0.5, cap => 2) $p$, - 1, -1, 2,'r'); - seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+---------+----------+-----------+---------+------+------+------+---------- - 1 | 1 | 1 | 1 | -1 | 1 | 6 | 1 | 0 - 2 | 1 | 2 | 1 | -1 | 3 | 7 | 1 | 1 - 3 | 1 | 3 | 1 | -1 | 7 | 8 | 1 | 2 - 4 | 1 | 4 | 1 | -1 | 11 | 9 | 1 | 3 - 5 | 1 | 5 | 1 | -1 | 16 | 16 | 1 | 4 - 6 | 1 | 6 | 1 | -1 | 15 | 3 | 1 | 5 - 7 | 1 | 7 | 1 | -1 | 10 | 5 | 0.8 | 6 - 8 | 1 | 8 | 1 | -1 | -1 | -1 | 0 | 6.8 - 9 | 2 | 1 | 1 | -1 | 1 | 6 | 1 | 0 - 10 | 2 | 2 | 1 | -1 | 3 | 7 | 1 | 1 - 11 | 2 | 3 | 1 | -1 | 7 | 10 | 1 | 2 - 12 | 2 | 4 | 1 | -1 | 8 | 12 | 1 | 3 - 13 | 2 | 5 | 1 | -1 | 12 | 13 | 1 | 4 - 14 | 2 | 6 | 1 | -1 | 17 | 15 | 1 | 5 - 15 | 2 | 7 | 1 | -1 | 16 | 16 | 1 | 6 - 16 | 2 | 8 | 1 | -1 | 15 | 3 | 1 | 7 - 17 | 2 | 9 | 1 | -1 | 10 | 5 | 0.8 | 8 - 18 | 2 | 10 | 1 | -1 | -1 | -1 | 0 | 8.8 + 1, -1, 2, + driving_side := 'r'); +WARNING: pgr_withPointsKSP(text,text,bigint,bigint,integer,boolean,boolean,char,boolean) deprecated on v3.6.0 + seq | path_id | path_seq | node | edge | cost | agg_cost +-----+---------+----------+------+------+------+---------- + 1 | 1 | 1 | 1 | 6 | 1 | 0 + 2 | 1 | 2 | 3 | 7 | 1 | 1 + 3 | 1 | 3 | 7 | 8 | 1 | 2 + 4 | 1 | 4 | 11 | 9 | 1 | 3 + 5 | 1 | 5 | 16 | 16 | 1 | 4 + 6 | 1 | 6 | 15 | 3 | 1 | 5 + 7 | 1 | 7 | 10 | 5 | 0.8 | 6 + 8 | 1 | 8 | -1 | -1 | 0 | 6.8 + 9 | 2 | 1 | 1 | 6 | 1 | 0 + 10 | 2 | 2 | 3 | 7 | 1 | 1 + 11 | 2 | 3 | 7 | 10 | 1 | 2 + 12 | 2 | 4 | 8 | 12 | 1 | 3 + 13 | 2 | 5 | 12 | 13 | 1 | 4 + 14 | 2 | 6 | 17 | 15 | 1 | 5 + 15 | 2 | 7 | 16 | 16 | 1 | 6 + 16 | 2 | 8 | 15 | 3 | 1 | 7 + 17 | 2 | 9 | 10 | 5 | 0.8 | 8 + 18 | 2 | 10 | -1 | -1 | 0 | 8.8 (18 rows) -/* --q7 */ -SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - -1, -3, 2, 'l', details := true); - seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+---------+----------+-----------+---------+------+------+------+---------- - 1 | 1 | 1 | -1 | -3 | -1 | 1 | 0.6 | 0 - 2 | 1 | 2 | -1 | -3 | 6 | 4 | 0.7 | 0.6 - 3 | 1 | 3 | -1 | -3 | -6 | 4 | 0.3 | 1.3 - 4 | 1 | 4 | -1 | -3 | 7 | 10 | 1 | 1.6 - 5 | 1 | 5 | -1 | -3 | 8 | 12 | 0.6 | 2.6 - 6 | 1 | 6 | -1 | -3 | -3 | -1 | 0 | 3.2 -(6 rows) - -/* --q8 */ -SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - -1, -2, 2, 'r', - heap_paths := true, details := true); - seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+---------+----------+-----------+---------+------+------+------+---------- - 1 | 1 | 1 | -1 | -2 | -1 | 1 | 0.4 | 0 - 2 | 1 | 2 | -1 | -2 | 5 | 1 | 1 | 0.4 - 3 | 1 | 3 | -1 | -2 | 6 | 4 | 0.7 | 1.4 - 4 | 1 | 4 | -1 | -2 | -6 | 4 | 0.3 | 2.1 - 5 | 1 | 5 | -1 | -2 | 7 | 8 | 1 | 2.4 - 6 | 1 | 6 | -1 | -2 | 11 | 9 | 1 | 3.4 - 7 | 1 | 7 | -1 | -2 | 16 | 15 | 0.4 | 4.4 - 8 | 1 | 8 | -1 | -2 | -2 | -1 | 0 | 4.8 - 9 | 2 | 1 | -1 | -2 | -1 | 1 | 0.4 | 0 - 10 | 2 | 2 | -1 | -2 | 5 | 1 | 1 | 0.4 - 11 | 2 | 3 | -1 | -2 | 6 | 4 | 0.7 | 1.4 - 12 | 2 | 4 | -1 | -2 | -6 | 4 | 0.3 | 2.1 - 13 | 2 | 5 | -1 | -2 | 7 | 8 | 1 | 2.4 - 14 | 2 | 6 | -1 | -2 | 11 | 11 | 1 | 3.4 - 15 | 2 | 7 | -1 | -2 | 12 | 13 | 1 | 4.4 - 16 | 2 | 8 | -1 | -2 | 17 | 15 | 1 | 5.4 - 17 | 2 | 9 | -1 | -2 | 16 | 15 | 0.4 | 6.4 - 18 | 2 | 10 | -1 | -2 | -2 | -1 | 0 | 6.8 - 19 | 3 | 1 | -1 | -2 | -1 | 1 | 0.4 | 0 - 20 | 3 | 2 | -1 | -2 | 5 | 1 | 1 | 0.4 - 21 | 3 | 3 | -1 | -2 | 6 | 4 | 0.7 | 1.4 - 22 | 3 | 4 | -1 | -2 | -6 | 4 | 0.3 | 2.1 - 23 | 3 | 5 | -1 | -2 | 7 | 10 | 1 | 2.4 - 24 | 3 | 6 | -1 | -2 | 8 | 12 | 0.6 | 3.4 - 25 | 3 | 7 | -1 | -2 | -3 | 12 | 0.4 | 4 - 26 | 3 | 8 | -1 | -2 | 12 | 13 | 1 | 4.4 - 27 | 3 | 9 | -1 | -2 | 17 | 15 | 1 | 5.4 - 28 | 3 | 10 | -1 | -2 | 16 | 15 | 0.4 | 6.4 - 29 | 3 | 11 | -1 | -2 | -2 | -1 | 0 | 6.8 -(29 rows) - -/* --q9 */ +/* -- q5 */ ROLLBACK; ROLLBACK diff --git a/docqueries/withPoints/doc-pgr_withPointsKSP.test.sql b/docqueries/withPoints/doc-pgr_withPointsKSP.test.sql index 04c2484c40..89ed7818ae 100644 --- a/docqueries/withPoints/doc-pgr_withPointsKSP.test.sql +++ b/docqueries/withPoints/doc-pgr_withPointsKSP.test.sql @@ -5,30 +5,20 @@ SET extra_float_digits=-3; SELECT * FROM pgr_withPointsKSP( 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - -1, -2, 2, 'l'); + -1, -2, 2); /* --q2 */ SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - -1, ARRAY[-3, 7], 2, 'B', - directed => false); + 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', + 'SELECT pid, edge_id, fraction, side from pointsOfInterest', + -1, -2, 2, + driving_side := 'l', details := true); /* --q3 */ SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - ARRAY[-1, 6], -3, 1,'r', details:= true); + 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', + 'SELECT pid, edge_id, fraction, side from pointsOfInterest', + -1, -2, 2, + heap_paths := true, driving_side := 'r', details := true); /* --q4 */ -SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - ARRAY[-1, 6], ARRAY[-3, 1], 1, 'l', heap_paths:= true); -/* --q5 */ -SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - 'SELECT * FROM (VALUES (-1, 10), (6, -3)) AS combinations(source, target)', - 2, 'r', details => true); -/* --q6 */ SELECT * FROM pgr_withPointsKSP( $e$ SELECT * FROM edges $e$, $p$ SELECT edge_id, round(fraction::numeric, 2) AS fraction, side @@ -37,16 +27,6 @@ SELECT * FROM pgr_withPointsKSP( (SELECT ST_POINT(2.9, 1.8)), 0.5, cap => 2) $p$, - 1, -1, 2,'r'); -/* --q7 */ -SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - -1, -3, 2, 'l', details := true); -/* --q8 */ -SELECT * FROM pgr_withPointsKSP( - 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', - 'SELECT pid, edge_id, fraction, side from pointsOfInterest', - -1, -2, 2, 'r', - heap_paths := true, details := true); -/* --q9 */ \ No newline at end of file + 1, -1, 2, + driving_side := 'r'); +/* -- q5 */ diff --git a/sql/scripts/build-extension-update-files.pl b/sql/scripts/build-extension-update-files.pl index 4c260e9ab9..e703a68bf7 100755 --- a/sql/scripts/build-extension-update-files.pl +++ b/sql/scripts/build-extension-update-files.pl @@ -233,13 +233,9 @@ sub generate_upgrade_script { # updating to 3.6+ if ($old_mayor == 2 or $old_minor < 6) { - push @commands, drop_special_case_function("pgr_withpointsksp(text, text, bigint, bigint, integer, boolean, boolean, char, boolean)"); push @commands, drop_special_case_function("pgr_astar(text,anyarray,bigint,boolean,integer,double precision,double precision)"); push @commands, drop_special_case_function("pgr_astar(text,bigint,anyarray,boolean,integer,double precision,double precision)"); push @commands, drop_special_case_function("pgr_astar(text,bigint,bigint,boolean,integer,double precision,double precision)"); - push @commands, drop_special_case_function("pgr_bdastar(text,bigint,bigint,boolean,integer,numeric,numeric)"); - push @commands, drop_special_case_function("pgr_bdastar(text,bigint,anyarray,boolean,integer,numeric,numeric)"); - push @commands, drop_special_case_function("pgr_bdastar(text,anyarray,bigint,boolean,integer,numeric,numeric)"); } } diff --git a/src/ksp/withPoints_ksp.c b/src/ksp/withPoints_ksp.c index 7f0731db14..f8c25366d9 100644 --- a/src/ksp/withPoints_ksp.c +++ b/src/ksp/withPoints_ksp.c @@ -370,15 +370,17 @@ process( PGR_DBG("Starting processing"); clock_t start_t = clock(); - do_pgr_withPointsKsp( + pgr_do_withPointsKsp( edges, total_edges, points, total_points, edges_of_points, total_edges_of_points, - start_pid, - end_pid, + NULL, 0, + + &start_pid, 1, + &end_pid, 1, k, directed,