Skip to content

Commit 858b385

Browse files
authored
Merge pull request #2686 from cvvergara/issue-2681-Remove-deprecated-pgr_trspViaEdges
Remove deprecated pgr_trspViaEdges
2 parents b9e41cc + 92647d5 commit 858b385

File tree

19 files changed

+154
-1075
lines changed

19 files changed

+154
-1075
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ include(pgr/BuildType)
2020

2121
project(PGROUTING VERSION 4.0.0
2222
LANGUAGES C CXX )
23-
set(PROJECT_VERSION_DEV "")
23+
set(PROJECT_VERSION_DEV "-dev")
2424
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
2525

2626
include(pgr/GitInfo)

NEWS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
### pgRouting 4.0.0 Release Notes
1010

11-
No Changes Yet
11+
**Removal of deprecated functions and signatures**
12+
13+
* ``pgr_trspviaedges(text,integer[],double precision[],boolean,boolean,text)``
14+
1215

1316

1417
# pgRouting 3

doc/src/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Available Functions but not official pgRouting functions
9191

9292
.. include:: release_notes.rst
9393
:start-after: current
94-
:end-before: pgRouting 3.6
94+
:end-before: pgRouting 3
9595

9696
All releases
9797
-------------------------------------------------------------------------------

doc/src/migration.rst

Lines changed: 19 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,145 +1291,59 @@ function been migrated then:
12911291
* ``id2`` is the node
12921292
* ``id3`` is the edge
12931293

1294-
Migration of ``pgr_trspViaEdges``
1294+
Migration of pgr_trspViaEdges
12951295
-------------------------------------------------------------------------------
12961296

1297-
Signature to be migrated:
1298-
1299-
.. parsed-literal::
1300-
1301-
pgr_trspViaEdges(sql text, eids integer[], pcts float8[],
1302-
directed boolean, has_rcost boolean
1303-
[, turn_restrict_sql text]);
1304-
RETURNS SETOF (seq, id1, id2, id3, cost)
1305-
1306-
1307-
* The integral types of the ``Edges SQL`` can only be ``INTEGER``.
1308-
* The floating point type of the ``Edges SQL`` can only be ``FLOAT``.
1309-
* ``directed`` flag is compulsory.
1310-
1311-
* Does not have a default value.
1312-
1313-
* Does not autodetect if ``reverse_cost`` column exist.
1314-
1315-
* User must be careful to match the existence of the column with the value of
1316-
``has_rcost`` parameter.
1317-
1318-
* The restrictions inner query is optional.
1319-
1320-
For these migration guide the following points will be used:
1321-
1322-
.. literalinclude:: migration.queries
1323-
:start-after: --viav7
1324-
:end-before: --edgesvia1
1325-
1326-
And will travel thru the following Via points :math:`4\rightarrow3\rightarrow6`
1327-
1328-
Migrate by using:
1329-
1330-
* :doc:`pgr_withPointsVia` when there are no restrictions,
1331-
* :doc:`pgr_trspVia_withPoints` when there are restrictions.
1297+
.. contents::
1298+
:local:
1299+
:depth: 1
13321300

1333-
Migrating ``pgr_trspViaEdges`` using ``pgr_withPointsVia``
1334-
...............................................................................
1335-
1336-
The following query does not have restrictions.
1301+
In this section this set of points is going to be used:
13371302

13381303
.. literalinclude:: migration.queries
13391304
:start-after: --edgesvia1
13401305
:end-before: --edgesvia2
13411306

1342-
* A message about deprecation is shown
1343-
1344-
* Deprecated functions will be removed on the next mayor version 4.0.0
1307+
Migrating pgr_trspViaEdges using pgr_withPointsVia
1308+
...............................................................................
13451309

1346-
Use :doc:`pgr_withPointsVia` instead.
1310+
Using :doc:`pgr_withPointsVia`.
13471311

13481312
.. literalinclude:: migration.queries
13491313
:start-after: --edgesvia2
13501314
:end-before: --edgesvia3
13511315

1352-
* The types casting has been removed.
1353-
* Do not show details, as the deprecated function does not show details.
1354-
* :doc:`pgr_withPointsVia`:
1355-
1356-
* Autodetects if ``reverse_cost`` column is in the edges
1357-
SQL.
1358-
* Accepts ``ANY-INTEGER`` on integral types
1359-
* Accepts ``ANY-NUMERICAL`` on floating point types
1360-
* ``directed`` flag has a default value of ``true``.
1361-
1362-
* Use the same value that on the original query.
1363-
* In this example it is ``true`` which is the default value.
1364-
1365-
* The flag has been omitted and the default is been used.
1366-
* On the points query do not include the ``side`` column.
1367-
1368-
When the need of using strictly the same (meaningless) names and types, and node
1369-
values of the function been migrated then:
1370-
1371-
.. literalinclude:: migration.queries
1372-
:start-after: --edgesvia3
1373-
:end-before: --edgesvia4
1316+
When the need of using the same (meaningless) names and and strict types then
1317+
convert the result to the deprecated function columns:
13741318

13751319
* ``id1`` is the path identifier
13761320
* ``id2`` is the node
13771321
* ``id3`` is the edge
13781322

1379-
Migrating ``pgr_trspViaEdges`` using ``pgr_trspVia_withPoints``
1380-
...............................................................................
1381-
1382-
The following query has restrictions.
1383-
13841323
.. literalinclude:: migration.queries
1385-
:start-after: --edgesvia4
1386-
:end-before: --edgesvia5
1387-
1388-
* A message about deprecation is shown
1389-
1390-
* Deprecated functions will be removed on the next mayor version 4.0.0
1391-
1392-
* The restrictions are the last parameter of the function
1324+
:start-after: --edgesvia3
1325+
:end-before: --edgesvia4
13931326

1394-
* Using the old structure of restrictions
1327+
Migrating pgr_trspViaEdges using pgr_trspVia_withPoints
1328+
...............................................................................
13951329

13961330
Use :doc:`pgr_trspVia_withPoints` instead.
13971331

13981332
.. literalinclude:: migration.queries
13991333
:start-after: --edgesvia5
14001334
:end-before: --edgesvia6
14011335

1402-
* The new structure of restrictions is been used.
1403-
1404-
* It is the second parameter.
1336+
When the need of using the same (meaningless) names and and strict types then
1337+
convert the result to the deprecated function columns:
14051338

1406-
* The types casting has been removed.
1407-
* Do not show details, as the deprecated function does not show details.
1408-
* :doc:`pgr_trspVia_withPoints`:
1409-
1410-
* Autodetects if ``reverse_cost`` column is in the edges
1411-
SQL.
1412-
* Accepts ``ANY-INTEGER`` on integral types
1413-
* Accepts ``ANY-NUMERICAL`` on floating point types
1414-
* ``directed`` flag has a default value of ``true``.
1415-
1416-
* Use the same value that on the original query.
1417-
* In this example it is ``true`` which is the default value.
1418-
1419-
* The flag has been omitted and the default is been used.
1420-
* On the points query do not include the ``side`` column.
1421-
1422-
When the need of using strictly the same (meaningless) names and types, and node
1423-
values of the function been migrated then:
1339+
* ``id1`` is the path identifier
1340+
* ``id2`` is the node
1341+
* ``id3`` is the edge
14241342

14251343
.. literalinclude:: migration.queries
14261344
:start-after: --edgesvia6
14271345
:end-before: --edgesvia7
14281346

1429-
* ``id1`` is the path identifier
1430-
* ``id2`` is the node
1431-
* ``id3`` is the edge
1432-
14331347

14341348
See Also
14351349
-------------------------------------------------------------------------------

doc/src/release_notes.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ pgRouting 4.0
3939
pgRouting 4.0.0 Release Notes
4040
-------------------------------------------------------------------------------
4141

42-
No Changes Yet
42+
.. rubric:: Removal of deprecated functions and signatures
43+
44+
* ``pgr_trspviaedges(text,integer[],double precision[],boolean,boolean,text)``
45+
4346

4447

4548
pgRouting 3

docqueries/src/migration.pg

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ WHERE edge != -1;
156156
SELECT pid, edge_id, fraction, side FROM pointsOfInterest
157157
WHERE pid IN (3, 4, 6);
158158
/* --edgesvia1 */
159-
SELECT * FROM pgr_trspViaEdges(
160-
$$SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edges$$,
161-
ARRAY[6, 12, 4], ARRAY[0.3, 0.6, 0.7],
162-
true, true);
159+
SELECT pid, edge_id, fraction FROM pointsOfInterest WHERE pid IN (3, 4, 6);
163160
/* --edgesvia2 */
164161
SELECT * FROM pgr_withPointsVia(
165162
$$SELECT id, source, target, cost, reverse_cost FROM edges$$,
@@ -172,15 +169,10 @@ path_id::INTEGER AS id1, node::INTEGER AS id2,
172169
CASE WHEN edge >= 0 THEN edge::INTEGER ELSE -1 END AS id3, cost::FLOAT
173170
FROM pgr_withPointsVia(
174171
$$SELECT id, source, target, cost, reverse_cost FROM edges$$,
175-
$$SELECT * FROM (VALUES (1, 6, 0.3),(2, 12, 0.6),(3, 4, 0.7)) AS t(pid, edge_id, fraction)$$,
176-
ARRAY[-1, -2, -3],
177-
details=> false);
172+
$$SELECT pid, edge_id, fraction FROM pointsOfInterest WHERE pid IN (3, 4, 6)$$,
173+
ARRAY[-4, -3, -6],
174+
details => false);
178175
/* --edgesvia4 */
179-
SELECT * FROM pgr_trspViaEdges(
180-
$$SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edges$$,
181-
ARRAY[6, 12, 4], ARRAY[0.3, 0.6, 0.7],
182-
true, true,
183-
$$SELECT to_cost, target_id::INTEGER, via_path FROM old_restrictions$$);
184176
/* --edgesvia5 */
185177
SELECT * FROM pgr_trspVia_withPoints(
186178
$$SELECT id, source, target, cost, reverse_cost FROM edges$$,

docqueries/src/migration.result

Lines changed: 14 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -404,26 +404,13 @@ WHERE pid IN (3, 4, 6);
404404
(3 rows)
405405

406406
/* --edgesvia1 */
407-
SELECT * FROM pgr_trspViaEdges(
408-
$$SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edges$$,
409-
ARRAY[6, 12, 4], ARRAY[0.3, 0.6, 0.7],
410-
true, true);
411-
WARNING: pgr_trspViaEdges(text,integer[],float[],boolean,boolean,text) deprecated function on v3.4.0
412-
seq | id1 | id2 | id3 | cost
413-
-----+-----+-----+-----+------
414-
1 | 1 | -1 | 6 | 0.7
415-
2 | 1 | 3 | 7 | 1
416-
3 | 1 | 7 | 10 | 1
417-
4 | 1 | 8 | 12 | 0.6
418-
5 | 1 | -2 | -1 | 0
419-
6 | 2 | -2 | 12 | 0.4
420-
7 | 2 | 12 | 13 | 1
421-
8 | 2 | 17 | 15 | 1
422-
9 | 2 | 16 | 9 | 1
423-
10 | 2 | 11 | 8 | 1
424-
11 | 2 | 7 | 4 | 0.7
425-
12 | 2 | -3 | -2 | 0
426-
(12 rows)
407+
SELECT pid, edge_id, fraction FROM pointsOfInterest WHERE pid IN (3, 4, 6);
408+
pid | edge_id | fraction
409+
-----+---------+----------
410+
3 | 12 | 0.6
411+
4 | 6 | 0.3
412+
6 | 4 | 0.7
413+
(3 rows)
427414

428415
/* --edgesvia2 */
429416
SELECT * FROM pgr_withPointsVia(
@@ -453,53 +440,26 @@ path_id::INTEGER AS id1, node::INTEGER AS id2,
453440
CASE WHEN edge >= 0 THEN edge::INTEGER ELSE -1 END AS id3, cost::FLOAT
454441
FROM pgr_withPointsVia(
455442
$$SELECT id, source, target, cost, reverse_cost FROM edges$$,
456-
$$SELECT * FROM (VALUES (1, 6, 0.3),(2, 12, 0.6),(3, 4, 0.7)) AS t(pid, edge_id, fraction)$$,
457-
ARRAY[-1, -2, -3],
458-
details=> false);
443+
$$SELECT pid, edge_id, fraction FROM pointsOfInterest WHERE pid IN (3, 4, 6)$$,
444+
ARRAY[-4, -3, -6],
445+
details => false);
459446
seq | id1 | id2 | id3 | cost
460447
-----+-----+-----+-----+------
461-
1 | 1 | -1 | 6 | 0.7
448+
1 | 1 | -4 | 6 | 0.7
462449
2 | 1 | 3 | 7 | 1
463450
3 | 1 | 7 | 10 | 1
464451
4 | 1 | 8 | 12 | 0.6
465-
5 | 1 | -2 | -1 | 0
466-
6 | 2 | -2 | 12 | 0.4
452+
5 | 1 | -3 | -1 | 0
453+
6 | 2 | -3 | 12 | 0.4
467454
7 | 2 | 12 | 13 | 1
468455
8 | 2 | 17 | 15 | 1
469456
9 | 2 | 16 | 9 | 1
470457
10 | 2 | 11 | 8 | 1
471458
11 | 2 | 7 | 4 | 0.3
472-
12 | 2 | -3 | -1 | 0
459+
12 | 2 | -6 | -1 | 0
473460
(12 rows)
474461

475462
/* --edgesvia4 */
476-
SELECT * FROM pgr_trspViaEdges(
477-
$$SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edges$$,
478-
ARRAY[6, 12, 4], ARRAY[0.3, 0.6, 0.7],
479-
true, true,
480-
$$SELECT to_cost, target_id::INTEGER, via_path FROM old_restrictions$$);
481-
WARNING: pgr_trspViaEdges(text,integer[],float[],boolean,boolean,text) deprecated function on v3.4.0
482-
WARNING: pgr_trsp(text,integer,float,integer,float,boolean,boolean) deprecated signature on v3.4.0
483-
WARNING: pgr_trsp(text,integer,float,integer,float,boolean,boolean) deprecated signature on v3.4.0
484-
seq | id1 | id2 | id3 | cost
485-
-----+-----+-----+-----+------
486-
1 | 1 | -1 | 6 | 0.7
487-
2 | 1 | 3 | 7 | 1
488-
3 | 1 | 7 | 8 | 1
489-
4 | 1 | 11 | 9 | 1
490-
5 | 1 | 16 | 16 | 1
491-
6 | 1 | 15 | 3 | 1
492-
7 | 1 | 10 | 2 | 1
493-
8 | 1 | 6 | 4 | 1
494-
9 | 1 | 7 | 10 | 1
495-
10 | 1 | 8 | 12 | 1
496-
11 | 2 | 12 | 13 | 1
497-
12 | 2 | 17 | 15 | 1
498-
13 | 2 | 16 | 9 | 1
499-
14 | 2 | 11 | 8 | 1
500-
15 | 2 | 7 | 4 | 0.3
501-
(15 rows)
502-
503463
/* --edgesvia5 */
504464
SELECT * FROM pgr_trspVia_withPoints(
505465
$$SELECT id, source, target, cost, reverse_cost FROM edges$$,

0 commit comments

Comments
 (0)