Motion: Deprecate pgr_nodeNetwork on v3.8.0
PSC vote:
- Yes
- No
0
voters
Community vote:
- Yes
- No
0
voters
Deprecation of pgr_nodeNetwork
Deprecated functions are deleted on next major version. In this case would be v4.0.0
Work done for deprecation
pgr_separateCrossing
has been created.- The user can grab the code and make adjustments.
- The user can see the results.
- The user can insert the results into a table.
pgr_separateTouching
has been created.- The user can grab the code and make adjustments.
- The user can see the results.
- The user can insert the results into a table.
pgr_nodeNetwork
has been rewritten:- Based on
pgr_separateCrossing
andpgr_separateTouching
. - Function no longer creates “unwanted” indexes on the table that has been noded or the resulting table.
- Based on
- Problems that remain in the function that will not be addressed in the future:
- Function stills create “unwanted” table.
- Function return OK or FAIL and only by reading NOTICE or DEBUG messages the user can figure out the problem.
- Function truncates result table deleting any previous work saved.
- The resulting table has a fixed name: original table name + suffix on the same schema as the original table.
How to work without pgr_nodeNetwork
Example of how to view results:
SELECT seq, id, sub_id, ST_AsText(geom)
FROM pgr_separateCrossing('SELECT id, geom FROM edges');
seq | id | sub_id | st_astext
-----+----+--------+---------------------------
1 | 13 | 1 | LINESTRING(3 3,3.5 3)
2 | 13 | 2 | LINESTRING(3.5 3,4 3)
3 | 18 | 1 | LINESTRING(3.5 2.3,3.5 3)
4 | 18 | 2 | LINESTRING(3.5 3,3.5 4)
Example of how to insert into a table:
INSERT INTO edges (old_id, geom)
SELECT id, geom
FROM pgr_separateCrossing('SELECT id, geom FROM edges');
Example of how the user can code the task the same way as pgr_nodeNetwork works
with more control on table names, types, indexes.
User can create the table of his choice in the location of his choice.
CREATE TABLE myshema.mytable AS ....
CREATE INDEX ....
INSERT INTO myshema.mytable (old_id, sub_id, geom)
SELECT id, sub_id, geom
FROM pgr_separateCrossing('SELECT id, the_geom AS geom')
UNION
FROM pgr_separateTouching('SELECT id, the_geom AS geom');
-- to get all the graph excluding the modified edges
INSERT INTO myshema.mytable (old_id, sub_id, geom)
WITH
original AS (SELECT id, geom FROM edges),
used AS (SELECT DISTINCT old_id FROM myshema.mytable)
SELECT id, 1 AS sub_id, the_geom
FROM original
WHERE id NOT IN (SELECT old_id FROM used))