Skip to content

Commit

Permalink
refining docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cvvergara committed Sep 8, 2023
1 parent 3573994 commit a847a72
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
13 changes: 10 additions & 3 deletions doc/src/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,11 @@ To migrate, use an unnamed valid value for **driving side** after the
:start-after: --withpointsdd4
:end-before: --withpointsdd5

If needed filter out the additional columns, for example, to return the original columns:
To get results from previous versions:

* filter out the additional columns, for example;
* When ``details => false`` to remove the points use ``WHERE node >= 0 OR cost =
0``

.. literalinclude:: migration.queries
:start-after: --withpointsdd5
Expand All @@ -529,8 +533,11 @@ example.
:start-after: --withpointsdd6
:end-before: --withpointsdd7

If needed filter out the additional columns, for example, to return the original
columns:
To get results from previous versions:

* Filter out the additional columns
* When ``details => false`` to remove the points use ``WHERE node >= 0 OR cost =
0``

.. literalinclude:: migration.queries
:start-after: --withpointsdd7
Expand Down
9 changes: 7 additions & 2 deletions doc/withPoints/pgr_withPointsDD.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@

* Added ``depth`` column.

* When ``details`` is ``false``:

* Only points that are visited are removed, that is, points reached within the
distance are included

* Deprecated signatures:

* ``pgr_withpointsdd(text,text,bigint,double precision,boolean,character,boolean)``
Expand Down Expand Up @@ -243,8 +248,8 @@ Find the driving distance from the two closest locations on the graph of point
:start-after: -- q5
:end-before: -- q6

* Point :math:`-1` corresponds to the closest edge from point `(2.9,1.8)`.
* Point :math:`-2` corresponds to the next close edge from point `(2.9,1.8)`.
* Point :math:`-1` corresponds to the closest edge from point :math:`(2.9,1.8)`.
* Point :math:`-2` corresponds to the next close edge from point :math:`(2.9,1.8)`.

Driving side does not matter
...............................................................................
Expand Down
21 changes: 9 additions & 12 deletions docqueries/src/migration.result
Original file line number Diff line number Diff line change
Expand Up @@ -841,14 +841,13 @@ WARNING: pgr_withpointsdd(text,text,bigint,double precision,boolean,character,b
SELECT * FROM pgr_withPointsDD(
$$SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id$$,
$$SELECT pid, edge_id, fraction, side from pointsOfInterest$$,
-1, 3.3, directed => true, driving_side => 'r');
WARNING: pgr_withpointsdd(text,text,bigint,double precision,boolean,character,boolean) is been deprecated
seq | node | edge | cost | agg_cost
-----+------+------+------+----------
1 | -1 | -1 | 0 | 0
2 | 5 | 1 | 0.4 | 0.4
3 | 6 | 1 | 1 | 1.4
4 | 7 | 4 | 1 | 2.4
-1, 3.3, 'r', directed => true);
seq | depth | start_vid | node | edge | cost | agg_cost
-----+-------+-----------+------+------+------+----------
1 | 0 | -1 | -1 | -1 | 0 | 0
2 | 1 | -1 | 5 | 1 | 0.4 | 0.4
3 | 2 | -1 | 6 | 1 | 1 | 1.4
4 | 3 | -1 | 7 | 4 | 1 | 2.4
(4 rows)

/* --withpointsdd5 */
Expand Down Expand Up @@ -892,7 +891,7 @@ SELECT * FROM pgr_withPointsDD(
SELECT seq, start_vid, node, edge, cost, agg_cost FROM pgr_withPointsDD(
$$SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id$$,
$$SELECT pid, edge_id, fraction, side from pointsOfInterest$$,
ARRAY[-1, 16], 3.3, 'l', equicost => true);
ARRAY[-1, 16], 3.3, 'l', equicost => true) WHERE node >= 0 OR cost = 0;
seq | start_vid | node | edge | cost | agg_cost
-----+-----------+------+------+------+----------
1 | -1 | -1 | -1 | 0 | 0
Expand All @@ -901,15 +900,13 @@ SELECT seq, start_vid, node, edge, cost, agg_cost FROM pgr_withPointsDD(
4 | -1 | 5 | 1 | 1 | 1.6
5 | -1 | 3 | 7 | 1 | 2.6
6 | -1 | 8 | 10 | 1 | 2.6
7 | -1 | -3 | 12 | 0.6 | 3.2
8 | -1 | -4 | 6 | 0.7 | 3.3
9 | 16 | 16 | -1 | 0 | 0
10 | 16 | 11 | 9 | 1 | 1
11 | 16 | 15 | 16 | 1 | 1
12 | 16 | 17 | 15 | 1 | 1
13 | 16 | 10 | 3 | 1 | 2
14 | 16 | 12 | 11 | 1 | 2
(14 rows)
(12 rows)

/* --withpointsdd8 */
/* --withPointsKSP1 */
Expand Down
4 changes: 2 additions & 2 deletions docqueries/src/migration.test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ SELECT * FROM pgr_withPointsDD(
SELECT * FROM pgr_withPointsDD(
$$SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id$$,
$$SELECT pid, edge_id, fraction, side from pointsOfInterest$$,
-1, 3.3, directed => true, driving_side => 'r');
-1, 3.3, 'r', directed => true);
/* --withpointsdd5 */
SELECT seq, node, edge, cost, agg_cost FROM pgr_withPointsDD(
$$SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id$$,
Expand All @@ -295,7 +295,7 @@ SELECT * FROM pgr_withPointsDD(
SELECT seq, start_vid, node, edge, cost, agg_cost FROM pgr_withPointsDD(
$$SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id$$,
$$SELECT pid, edge_id, fraction, side from pointsOfInterest$$,
ARRAY[-1, 16], 3.3, 'l', equicost => true);
ARRAY[-1, 16], 3.3, 'l', equicost => true) WHERE node >= 0 OR cost = 0;
/* --withpointsdd8 */
/* --withPointsKSP1 */
SELECT * FROM pgr_withPointsKSP(
Expand Down

0 comments on commit a847a72

Please sign in to comment.