forked from pgRouting/pgrouting
-
Notifications
You must be signed in to change notification settings - Fork 0
Migration Guide
Vicky Vergara edited this page Mar 14, 2017
·
4 revisions
How to detect that it needs migration
- when the output columns are
(seq, id1, id2, cost) - when the
pgr_bdAstarends with two boolean values - when the inner query columns need casting
What to do
- Adjust the returning to the new column names
(seq, path_seq, node, edge, cost, agg_cost)-
id1is nownode -
id2is nowedge
-
- Remove the inner query casting
- Remove any contradiction
- when the last boolean value has a value false: physically the column
reverse_costmust not exist in the inner query - when the last boolean value has a value true: physically the column
reverse_costmust exist in the inner query
- when the last boolean value has a value false: physically the column
- Remove the last boolean value
Example
SELECT seq, id1, id2, cost FROM pgr_bdAStar(
'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost, x1, y1, x2, y2
FROM edge_table',
4, 10, false, false);
migrates to
SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_bdAStar(
'SELECT id, source, target, cost, x1, y1, x2, y2
FROM edge_table',
4, 10, false);
How to detect that it needs migration
- The function has
maxFlowon the name - when the output columns are
(seq, edge_id, source, target, flow, residual_capacity)
What to do
- Adjust the returning columns to the new column names
(seq, edge, start_vid, end_vid, flow, residual_capacity)-
sourceis nowstart_vid -
targetis nowend_vid
-
- Change the name acordingly:
-
pgr_maxFlowBoykovKolmogorovtopgr_boykovKolmogorov -
pgr_maxFlowEdmondsKarptopgr_edmondsKarp -
pgr_maxFlowPushRelabeltopgr_pushRelabel
-
Example
SELECT seq, edge_id, source, target, flow, residual_capacity
FROM pgr_maxFlowBoykovKolmogorov(
'SELECT id, source, target, capacity, reverse_capacity
FROM edge_table',
6, 11
);
migrates to
SELECT seq, edge, start_vid, end_vid, flow, residual_capacity
FROM pgr_boykovKolmogorov(
'SELECT id, source, target, capacity, reverse_capacity
FROM edge_table',
6, 11
);
Availability: 2.0.x Deprecated: 2.1.0
what to do
given 'my_table' with the columns (gid, my_point_geom)
SELECT gid AS id
FROM my_table
WHERE ST_Equals( my_point_geom, ST_SetSRID(ST_Point(-71.1043443253471, 42.3150676015829),4326))