diff --git a/NEWS.md b/NEWS.md index 83bea8d9ee1..c70e4ab4f0d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -40,6 +40,8 @@ milestone for 3.8.0 pgr_analyzeOneWay * [#2753](https://github.com/pgRouting/pgrouting/issues/2753): pgr_analyzeGraph +* [#2750](https://github.com/pgRouting/pgrouting/issues/2750): + pgr_createTopology * [#2826](https://github.com/pgRouting/pgrouting/issues/2826): pgr_createVerticesTable diff --git a/doc/_static/page_history.js b/doc/_static/page_history.js index 2ddb43f2af5..93cf0be1e57 100644 --- a/doc/_static/page_history.js +++ b/doc/_static/page_history.js @@ -220,7 +220,7 @@ var filesArr = [ ]), new createInfo('pgr_createTopology', '2.0', [ { v: '2.1', n: 'src/common/doc/functions/create_topology'}, - { v: '2.3', n: 'src/topology/doc/pgr_createTopology'}, + { v: '2.3', n: 'src/topology/doc/pgr_createTopology'}, 3.8 ]), new createInfo('pgr_analyzeOneWay', '2.0', [ { v: '2.1', n: 'src/common/doc/functions/analyze_oneway'}, diff --git a/doc/contraction/pgr_contractionDeadEnd.rst b/doc/contraction/pgr_contractionDeadEnd.rst index 708a07bf800..36033b293dc 100644 --- a/doc/contraction/pgr_contractionDeadEnd.rst +++ b/doc/contraction/pgr_contractionDeadEnd.rst @@ -139,7 +139,7 @@ Contraction optional parameters - Type - Default - Description - * - ``forbidden_vertices`` + * - ``forbidden`` - ``ARRAY[`` |ANY-INTEGER| ``]`` - **Empty** - Identifiers of vertices forbidden for contraction. diff --git a/doc/max_flow/pgr_maxFlow.rst b/doc/max_flow/pgr_maxFlow.rst index ee3e858a01f..0ecd4e1b2de 100644 --- a/doc/max_flow/pgr_maxFlow.rst +++ b/doc/max_flow/pgr_maxFlow.rst @@ -45,7 +45,7 @@ Description - Calculates the maximum flow from the sources to the targets. - When the maximum flow is **0** then there is no flow and **0** is returned. - - There is no flow when source has the same vaule as target. + - There is no flow when source has the same value as target. - Any duplicated values in source or target are ignored. - Uses the :doc:`pgr_pushRelabel ` algorithm. diff --git a/doc/max_flow/pgr_maxFlowMinCost_Cost.rst b/doc/max_flow/pgr_maxFlowMinCost_Cost.rst index 5de1974f934..9b4b52e5daf 100644 --- a/doc/max_flow/pgr_maxFlowMinCost_Cost.rst +++ b/doc/max_flow/pgr_maxFlowMinCost_Cost.rst @@ -46,7 +46,7 @@ Description - **The cost value of all input edges must be nonnegative.** - When the maximum flow is 0 then there is no flow and **0** is returned. - - There is no flow when source has the same vaule as target. + - There is no flow when source has the same value as target. - Any duplicated values in source or target are ignored. - Uses :doc:`pgr_maxFlowMinCost`. diff --git a/doc/src/migration.rst b/doc/src/migration.rst index 5470635b836..03ebe82d40f 100644 --- a/doc/src/migration.rst +++ b/doc/src/migration.rst @@ -24,6 +24,25 @@ Results can be different because of the changes. .. contents:: Contents :depth: 2 +.. migrate_pgr_createTopology_start + +Migration of ``pgr_createTopology`` +------------------------------------------------------------------------------- + +Starting from `v3.8.0 `__ + +**Before Deprecation:** The following was calculated: + +* A table with `_vertices_pgr` was created. + +**After Deprecation:** The user is responsible to create the complete topology. + +.. include:: pgRouting-concepts.rst + :start-after: createTopology_start + :end-before: createTopology_end + +.. migrate_pgr_createTopology_end + .. migrate_pgr_createVerticesTable_start Migration of ``pgr_createVerticesTable`` diff --git a/doc/src/pgRouting-concepts.rst b/doc/src/pgRouting-concepts.rst index e549b80af07..e4c6484da0e 100644 --- a/doc/src/pgRouting-concepts.rst +++ b/doc/src/pgRouting-concepts.rst @@ -489,6 +489,7 @@ The use of indexes on the database design in general: Please consult the `PostgreSQL `__ documentation and the `PostGIS `__ documentation. +.. createTopology_start Build a routing topology ............................................................................... @@ -516,10 +517,18 @@ If the columns do not exist they need to be added to the table in question. (see The function :doc:`pgr_extractVertices` is used to create a vertices table based on the edge identifier and the geometry of the edge of the graph. +.. literalinclude:: concepts.queries + :start-after: -- createTopology1 + :end-before: -- createTopology2 + Finally using the data stored on the vertices tables the ``source`` and ``target`` are filled up. -See :doc:`sampledata` for an example for building a topology. +.. literalinclude:: concepts.queries + :start-after: -- createTopology2 + :end-before: -- createTopology3 + +.. createTopology_end Data coming from OSM and using `osm2pgrouting `__ as an import tool, comes with diff --git a/doc/src/release_notes.rst b/doc/src/release_notes.rst index 92c06efe7f8..f7eb0125a98 100644 --- a/doc/src/release_notes.rst +++ b/doc/src/release_notes.rst @@ -72,6 +72,8 @@ milestone for 3.8.0 pgr_analyzeOneWay * `#2753 `__: pgr_analyzeGraph +* `#2750 `__: + pgr_createTopology * `#2826 `__: pgr_createVerticesTable diff --git a/doc/topology/pgr_analyzeGraph.rst b/doc/topology/pgr_analyzeGraph.rst index 2f897768e8f..5de5d9e225f 100644 --- a/doc/topology/pgr_analyzeGraph.rst +++ b/doc/topology/pgr_analyzeGraph.rst @@ -55,8 +55,6 @@ The edge table to be analyzed must contain a source column and a target column filled with id's of the vertices of the segments and the corresponding vertices table _vertices_pgr that stores the vertices information. -- Use :doc:`pgr_createTopology` to create the topology and the vertices table. - Parameters ------------------------------------------------------------------------------- @@ -95,9 +93,6 @@ The function returns: .. rubric:: The Vertices Table -The vertices table can be created with -:doc:`pgr_createTopology ` - The structure of the vertices table is: :id: ``bigint`` Identifier of the vertex. diff --git a/doc/topology/pgr_analyzeOneWay.rst b/doc/topology/pgr_analyzeOneWay.rst index 6de3780a25c..d2524736278 100644 --- a/doc/topology/pgr_analyzeOneWay.rst +++ b/doc/topology/pgr_analyzeOneWay.rst @@ -64,8 +64,6 @@ The edge table to be analyzed must contain a source column and a target column filled with id's of the vertices of the segments and the corresponding vertices table _vertices_pgr that stores the vertices information. -- Use :doc:`pgr_createTopology` to create the topology and the vertices table. - |Boost| Boost Graph Inside Signatures @@ -96,10 +94,6 @@ Parameters :two_way_if_null: ``boolean`` flag to treat oneway NULL values as bi-directional. Default value is ``true``. -.. note:: - It is strongly recommended to use the named notation. See - :doc:`pgr_createTopology` for examples. - The function returns: - ``OK`` after the analysis has finished. @@ -120,9 +114,6 @@ condition. .. rubric:: The Vertices Table -The vertices table can be created with -:doc:`pgr_createTopology` - The structure of the vertices table is: :id: ``bigint`` Identifier of the vertex. diff --git a/doc/topology/pgr_createTopology.rst b/doc/topology/pgr_createTopology.rst index 12e1a5d62f8..af0274d5a7f 100644 --- a/doc/topology/pgr_createTopology.rst +++ b/doc/topology/pgr_createTopology.rst @@ -8,12 +8,12 @@ **************************************************************************** .. index:: - single: Topology Family ; pgr_createTopology - single: createTopology + single: Topology Family ; pgr_createTopology - Deprecated since v3.8.0 + single: createTopology - Deprecated since v3.8.0 | -``pgr_createTopology`` +``pgr_createTopology`` - Deprecated since v3.8.0 =============================================================================== ``pgr_createTopology`` — Builds a network topology based on the geometry @@ -21,11 +21,19 @@ information. .. rubric:: Availability +* Version 3.8.0 + + * Deprecated function. + * Version 2.0.0 * Official function. * Renamed from version 1.x +.. include:: migration.rst + :start-after: migrate_pgr_createTopology_start + :end-before: migrate_pgr_createTopology_end + Description ------------------------------------------------------------------------------- diff --git a/doc/topology/pgr_createVerticesTable.rst b/doc/topology/pgr_createVerticesTable.rst index 1a58f1723ff..94446ec6984 100644 --- a/doc/topology/pgr_createVerticesTable.rst +++ b/doc/topology/pgr_createVerticesTable.rst @@ -286,8 +286,6 @@ See Also * :doc:`sampledata` * :doc:`topology-functions` for an overview of a topology for routing algorithms. -* :doc:`pgr_createTopology` ` to create a topology based on - the geometry. .. rubric:: Indices and tables diff --git a/doc/topology/pgr_nodeNetwork.rst b/doc/topology/pgr_nodeNetwork.rst index cbfe038eb47..09524cbc6e2 100644 --- a/doc/topology/pgr_nodeNetwork.rst +++ b/doc/topology/pgr_nodeNetwork.rst @@ -78,10 +78,8 @@ The output table will have for ``edge_table_noded`` :id: ``bigint`` Unique identifier for the table :old_id: ``bigint`` Identifier of the edge in original table :sub_id: ``integer`` Segment number of the original edge -:source: ``integer`` Empty source column to be used with - :doc:`pgr_createTopology` function -:target: ``integer`` Empty target column to be used with - :doc:`pgr_createTopology` function +:source: ``integer`` Empty source column +:target: ``integer`` Empty target column :the geom: ``geometry`` Geometry column of the noded network Examples @@ -234,7 +232,6 @@ See Also ------------------------------------------------------------------------------- :doc:`topology-functions` for an overview of a topology for routing algorithms. -:doc:`pgr_createTopology` to create a topology based on the geometry. .. rubric:: Indices and tables diff --git a/docqueries/lineGraph/proofOfConcept1.pg b/docqueries/lineGraph/proofOfConcept1.pg index 2005b3e888a..f131f145203 100644 --- a/docqueries/lineGraph/proofOfConcept1.pg +++ b/docqueries/lineGraph/proofOfConcept1.pg @@ -2,14 +2,15 @@ -- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/ -- TODO move to pgtap --- getting same results using pgr_createTopology DROP TABLE IF EXISTS edges1; -SELECT id, NULL::BIGINT as source, NULL::BIGINT as target, cost, reverse_cost, x1, x2, y1, y2, geom AS the_geom +SELECT id, source, target, cost, reverse_cost, x1, x2, y1, y2, geom INTO edges1 FROM edges ORDER BY id; -UPDATE edges1 SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)); -SELECT pgr_createTopology('edges1',0.001); +DROP TABLE IF EXISTS edges1_vertices_pgr; +SELECT * +INTO edges1_vertices_pgr +FROM vertices ORDER BY id; -- this is a hand made test UPDATE edges1 SET id = id * 100, source = 1000 * source, target = 1000 * target; @@ -100,20 +101,20 @@ WHERE DROP TABLE IF EXISTS q_result_1; SELECT * INTO q_result_1 FROM pgr_dijkstra($$SELECT seq AS id, * FROM result2$$, - (SELECT array_agg(id) FROM result2_vertices_pgr where original_id = 2000), - (SELECT array_agg(id) FROM result2_vertices_pgr where original_id = 3000) + (SELECT array_agg(id) FROM result2_vertices_pgr where original_id = 6000), + (SELECT array_agg(id) FROM result2_vertices_pgr where original_id = 10000) ); SELECT * FROM q_result_1; -- choosing the best many to many SELECT min(agg_cost) FROM q_result_1 WHERE edge = -1; SELECT path_seq, start_vid, end_vid FROM q_result_1 WHERE edge = -1 and agg_cost = 5; -SELECT * FROM q_result_1 WHERE start_vid = -3 AND end_vid = 3000; +SELECT * FROM q_result_1 WHERE start_vid = -3 AND end_vid = 10000; -- not showing the 0 cost edges -SELECT * FROM q_result_1 WHERE start_vid = -3 AND end_vid = 3000 AND (cost != 0 OR edge = -1); +SELECT * FROM q_result_1 WHERE start_vid = -3 AND end_vid = 10000 AND (cost != 0 OR edge = -1); -- not showing the 0 cost edges and showing the original edges WITH a AS ( SELECT * FROM q_result_1 - WHERE start_vid = -3 AND end_vid = 3000 AND (cost != 0 OR edge = -1)) + WHERE start_vid = -3 AND end_vid = 10000 AND (cost != 0 OR edge = -1)) SELECT a.seq, a.path_seq, (SELECT original_id FROM result2_vertices_pgr AS b WHERE a.start_vid = b.id) AS start_vid, @@ -124,4 +125,4 @@ FROM a; -- A Dijkstra SELECT * from pgr_dijkstra($$SELECT id, * FROM edges1$$, - ARRAY[2000], ARRAY[3000]); + ARRAY[6000], ARRAY[10000]); diff --git a/docqueries/lineGraph/proofOfConcept1.result b/docqueries/lineGraph/proofOfConcept1.result index 1b60687fca5..6db087156b9 100644 --- a/docqueries/lineGraph/proofOfConcept1.result +++ b/docqueries/lineGraph/proofOfConcept1.result @@ -5,26 +5,17 @@ SET DROP TABLE IF EXISTS edges1; NOTICE: table "edges1" does not exist, skipping DROP TABLE -SELECT id, NULL::BIGINT as source, NULL::BIGINT as target, cost, reverse_cost, x1, x2, y1, y2, geom AS the_geom +SELECT id, source, target, cost, reverse_cost, x1, x2, y1, y2, geom INTO edges1 FROM edges ORDER BY id; SELECT 18 -UPDATE edges1 SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)); -UPDATE 18 -SELECT pgr_createTopology('edges1',0.001); -NOTICE: PROCESSING: -NOTICE: pgr_createTopology('edges1', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f) -NOTICE: Performing checks, please wait ..... -NOTICE: Creating Topology, Please wait... -NOTICE: -------------> TOPOLOGY CREATED FOR 18 edges -NOTICE: Rows with NULL geometry or NULL id: 0 -NOTICE: Vertices table for table public.edges1 is: public.edges1_vertices_pgr -NOTICE: ---------------------------------------------- - pgr_createtopology --------------------- - OK -(1 row) - +DROP TABLE IF EXISTS edges1_vertices_pgr; +NOTICE: table "edges1_vertices_pgr" does not exist, skipping +DROP TABLE +SELECT * +INTO edges1_vertices_pgr +FROM vertices ORDER BY id; +SELECT 17 UPDATE edges1 SET id = id * 100, source = 1000 * source, target = 1000 * target; UPDATE 18 UPDATE edges1_vertices_pgr SET id = id * 1000; @@ -40,32 +31,32 @@ SELECT 95 SELECT * FROM result2; seq | source | target | cost | edge -----+--------+--------+------+------- - 1 | -1 | 2000 | 1 | 100 - 2 | 1000 | -1 | 0 | 0 - 3 | -2 | 1000 | 1 | -100 - 4 | -3 | 5000 | 1 | 400 - 5 | 2000 | -2 | 0 | 0 - 6 | 2000 | -3 | 0 | 0 + 1 | -1 | 6000 | 1 | 100 + 2 | 5000 | -1 | 0 | 0 + 3 | -2 | 5000 | 1 | -100 + 4 | -3 | 7000 | 1 | 400 + 5 | 6000 | -2 | 0 | 0 + 6 | 6000 | -3 | 0 | 0 7 | -4 | -2 | 0 | 0 8 | -4 | -3 | 0 | 0 9 | -5 | -2 | 0 | 0 10 | -5 | -3 | 0 | 0 11 | -6 | -4 | 1 | -200 - 12 | -7 | 6000 | 1 | 500 - 13 | 3000 | -6 | 0 | 0 - 14 | 3000 | -7 | 0 | 0 - 15 | -8 | 3000 | 1 | -300 + 12 | -7 | 11000 | 1 | 500 + 13 | 10000 | -6 | 0 | 0 + 14 | 10000 | -7 | 0 | 0 + 15 | -8 | 10000 | 1 | -300 16 | -9 | -30 | 1 | 1600 - 17 | 4000 | -8 | 0 | 0 - 18 | 4000 | -9 | 0 | 0 + 17 | 15000 | -8 | 0 | 0 + 18 | 15000 | -9 | 0 | 0 19 | -10 | -5 | 1 | -400 20 | -11 | -25 | 1 | -700 21 | -12 | -20 | 1 | 800 - 22 | -13 | 10000 | 1 | 1000 - 23 | 5000 | -10 | 0 | 0 - 24 | 5000 | -11 | 0 | 0 - 25 | 5000 | -12 | 0 | 0 - 26 | 5000 | -13 | 0 | 0 + 22 | -13 | 8000 | 1 | 1000 + 23 | 7000 | -10 | 0 | 0 + 24 | 7000 | -11 | 0 | 0 + 25 | 7000 | -12 | 0 | 0 + 26 | 7000 | -13 | 0 | 0 27 | -14 | -10 | 0 | 0 28 | -14 | -11 | 0 | 0 29 | -14 | -12 | 0 | 0 @@ -79,31 +70,31 @@ SELECT * FROM result2; 37 | -16 | -12 | 0 | 0 38 | -16 | -13 | 0 | 0 39 | -17 | -15 | 1 | -800 - 40 | -18 | 9000 | 1 | 900 - 41 | -19 | 11000 | 1 | 1100 - 42 | 6000 | -17 | 0 | 0 - 43 | 6000 | -18 | 0 | 0 - 44 | 6000 | -19 | 0 | 0 + 40 | -18 | 16000 | 1 | 900 + 41 | -19 | 12000 | 1 | 1100 + 42 | 11000 | -17 | 0 | 0 + 43 | 11000 | -18 | 0 | 0 + 44 | 11000 | -19 | 0 | 0 45 | -20 | -17 | 0 | 0 46 | -20 | -18 | 0 | 0 47 | -20 | -19 | 0 | 0 48 | -21 | -17 | 0 | 0 49 | -21 | -18 | 0 | 0 50 | -21 | -19 | 0 | 0 - 51 | -22 | 8000 | 1 | 600 - 52 | 7000 | -22 | 0 | 0 - 53 | -23 | 7000 | 1 | -600 + 51 | -22 | 3000 | 1 | 600 + 52 | 1000 | -22 | 0 | 0 + 53 | -23 | 1000 | 1 | -600 54 | -24 | -14 | 1 | 700 - 55 | 8000 | -23 | 0 | 0 - 56 | 8000 | -24 | 0 | 0 + 55 | 3000 | -23 | 0 | 0 + 56 | 3000 | -24 | 0 | 0 57 | -25 | -23 | 0 | 0 58 | -25 | -24 | 0 | 0 59 | -26 | -21 | 1 | -900 60 | -27 | -38 | 1 | 1500 - 61 | -28 | 4000 | 1 | -1600 - 62 | 9000 | -26 | 0 | 0 - 63 | 9000 | -27 | 0 | 0 - 64 | 9000 | -28 | 0 | 0 + 61 | -28 | 15000 | 1 | -1600 + 62 | 16000 | -26 | 0 | 0 + 63 | 16000 | -27 | 0 | 0 + 64 | 16000 | -28 | 0 | 0 65 | -29 | -26 | 0 | 0 66 | -29 | -27 | 0 | 0 67 | -29 | -28 | 0 | 0 @@ -112,29 +103,29 @@ SELECT * FROM result2; 70 | -30 | -28 | 0 | 0 71 | -31 | -16 | 1 | -1000 72 | -32 | -36 | 1 | 1200 - 73 | -33 | 13000 | 1 | 1400 - 74 | 10000 | -31 | 0 | 0 - 75 | 10000 | -32 | 0 | 0 - 76 | 10000 | -33 | 0 | 0 + 73 | -33 | 9000 | 1 | 1400 + 74 | 8000 | -31 | 0 | 0 + 75 | 8000 | -32 | 0 | 0 + 76 | 8000 | -33 | 0 | 0 77 | -34 | -31 | 0 | 0 78 | -34 | -32 | 0 | 0 79 | -34 | -33 | 0 | 0 - 80 | -35 | 12000 | 1 | 1300 - 81 | 11000 | -35 | 0 | 0 + 80 | -35 | 17000 | 1 | 1300 + 81 | 12000 | -35 | 0 | 0 82 | -36 | -35 | 0 | 0 83 | -37 | -29 | 1 | -1500 - 84 | 12000 | -37 | 0 | 0 + 84 | 17000 | -37 | 0 | 0 85 | -38 | -37 | 0 | 0 86 | -39 | -34 | 1 | -1400 - 87 | 13000 | -39 | 0 | 0 - 88 | -40 | 15000 | 1 | 1700 - 89 | 14000 | -40 | 0 | 0 - 90 | -41 | 14000 | 1 | -1700 - 91 | 15000 | -41 | 0 | 0 - 92 | -42 | 17000 | 1 | 1800 - 93 | 16000 | -42 | 0 | 0 - 94 | -43 | 16000 | 1 | -1800 - 95 | 17000 | -43 | 0 | 0 + 87 | 9000 | -39 | 0 | 0 + 88 | -40 | 4000 | 1 | 1700 + 89 | 2000 | -40 | 0 | 0 + 90 | -41 | 2000 | 1 | -1700 + 91 | 4000 | -41 | 0 | 0 + 92 | -42 | 14000 | 1 | 1800 + 93 | 13000 | -42 | 0 | 0 + 94 | -43 | 13000 | 1 | -1800 + 95 | 14000 | -43 | 0 | 0 (95 rows) DROP TABLE IF EXISTS result2_vertices_pgr; @@ -260,49 +251,49 @@ SELECT * FROM result2_vertices_pgr; 15000 | 15000 16000 | 16000 17000 | 17000 - -43 | 17000 - -42 | 16000 - -41 | 15000 - -40 | 14000 - -39 | 13000 - -37 | 12000 - -35 | 11000 - -33 | 10000 - -32 | 10000 - -31 | 10000 - -28 | 9000 - -27 | 9000 - -26 | 9000 - -24 | 8000 - -23 | 8000 - -22 | 7000 - -19 | 6000 - -18 | 6000 - -17 | 6000 - -13 | 5000 - -12 | 5000 - -11 | 5000 - -10 | 5000 - -9 | 4000 - -8 | 4000 - -7 | 3000 - -6 | 3000 - -3 | 2000 - -2 | 2000 - -1 | 1000 - -38 | 12000 - -36 | 11000 - -34 | 10000 - -30 | 9000 - -29 | 9000 - -25 | 8000 - -21 | 6000 - -20 | 6000 - -16 | 5000 - -15 | 5000 - -14 | 5000 - -5 | 2000 - -4 | 2000 + -43 | 14000 + -42 | 13000 + -41 | 4000 + -40 | 2000 + -39 | 9000 + -37 | 17000 + -35 | 12000 + -33 | 8000 + -32 | 8000 + -31 | 8000 + -28 | 16000 + -27 | 16000 + -26 | 16000 + -24 | 3000 + -23 | 3000 + -22 | 1000 + -19 | 11000 + -18 | 11000 + -17 | 11000 + -13 | 7000 + -12 | 7000 + -11 | 7000 + -10 | 7000 + -9 | 15000 + -8 | 15000 + -7 | 10000 + -6 | 10000 + -3 | 6000 + -2 | 6000 + -1 | 5000 + -38 | 17000 + -36 | 12000 + -34 | 8000 + -30 | 16000 + -29 | 16000 + -25 | 3000 + -21 | 11000 + -20 | 11000 + -16 | 7000 + -15 | 7000 + -14 | 7000 + -5 | 6000 + -4 | 6000 (60 rows) ALTER TABLE result2 ADD COLUMN original_source_vertex BIGINT; @@ -345,194 +336,194 @@ NOTICE: table "q_result_1" does not exist, skipping DROP TABLE SELECT * INTO q_result_1 FROM pgr_dijkstra($$SELECT seq AS id, * FROM result2$$, - (SELECT array_agg(id) FROM result2_vertices_pgr where original_id = 2000), - (SELECT array_agg(id) FROM result2_vertices_pgr where original_id = 3000) + (SELECT array_agg(id) FROM result2_vertices_pgr where original_id = 6000), + (SELECT array_agg(id) FROM result2_vertices_pgr where original_id = 10000) ); SELECT 181 SELECT * FROM q_result_1; - seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+----------+-----------+---------+------+------+------+---------- - 1 | 1 | -5 | -7 | -5 | 10 | 0 | 0 - 2 | 2 | -5 | -7 | -3 | 4 | 1 | 0 - 3 | 3 | -5 | -7 | 5000 | 25 | 0 | 1 - 4 | 4 | -5 | -7 | -12 | 21 | 1 | 1 - 5 | 5 | -5 | -7 | -20 | 46 | 0 | 2 - 6 | 6 | -5 | -7 | -18 | 40 | 1 | 2 - 7 | 7 | -5 | -7 | 9000 | 64 | 0 | 3 - 8 | 8 | -5 | -7 | -28 | 61 | 1 | 3 - 9 | 9 | -5 | -7 | 4000 | 17 | 0 | 4 - 10 | 10 | -5 | -7 | -8 | 15 | 1 | 4 - 11 | 11 | -5 | -7 | 3000 | 14 | 0 | 5 - 12 | 12 | -5 | -7 | -7 | -1 | 0 | 5 - 13 | 1 | -5 | -6 | -5 | 10 | 0 | 0 - 14 | 2 | -5 | -6 | -3 | 4 | 1 | 0 - 15 | 3 | -5 | -6 | 5000 | 25 | 0 | 1 - 16 | 4 | -5 | -6 | -12 | 21 | 1 | 1 - 17 | 5 | -5 | -6 | -20 | 46 | 0 | 2 - 18 | 6 | -5 | -6 | -18 | 40 | 1 | 2 - 19 | 7 | -5 | -6 | 9000 | 64 | 0 | 3 - 20 | 8 | -5 | -6 | -28 | 61 | 1 | 3 - 21 | 9 | -5 | -6 | 4000 | 17 | 0 | 4 - 22 | 10 | -5 | -6 | -8 | 15 | 1 | 4 - 23 | 11 | -5 | -6 | 3000 | 13 | 0 | 5 - 24 | 12 | -5 | -6 | -6 | -1 | 0 | 5 - 25 | 1 | -5 | 3000 | -5 | 10 | 0 | 0 - 26 | 2 | -5 | 3000 | -3 | 4 | 1 | 0 - 27 | 3 | -5 | 3000 | 5000 | 25 | 0 | 1 - 28 | 4 | -5 | 3000 | -12 | 21 | 1 | 1 - 29 | 5 | -5 | 3000 | -20 | 46 | 0 | 2 - 30 | 6 | -5 | 3000 | -18 | 40 | 1 | 2 - 31 | 7 | -5 | 3000 | 9000 | 64 | 0 | 3 - 32 | 8 | -5 | 3000 | -28 | 61 | 1 | 3 - 33 | 9 | -5 | 3000 | 4000 | 17 | 0 | 4 - 34 | 10 | -5 | 3000 | -8 | 15 | 1 | 4 - 35 | 11 | -5 | 3000 | 3000 | -1 | 0 | 5 - 36 | 1 | -4 | -7 | -4 | 8 | 0 | 0 - 37 | 2 | -4 | -7 | -3 | 4 | 1 | 0 - 38 | 3 | -4 | -7 | 5000 | 25 | 0 | 1 - 39 | 4 | -4 | -7 | -12 | 21 | 1 | 1 - 40 | 5 | -4 | -7 | -20 | 46 | 0 | 2 - 41 | 6 | -4 | -7 | -18 | 40 | 1 | 2 - 42 | 7 | -4 | -7 | 9000 | 64 | 0 | 3 - 43 | 8 | -4 | -7 | -28 | 61 | 1 | 3 - 44 | 9 | -4 | -7 | 4000 | 17 | 0 | 4 - 45 | 10 | -4 | -7 | -8 | 15 | 1 | 4 - 46 | 11 | -4 | -7 | 3000 | 14 | 0 | 5 - 47 | 12 | -4 | -7 | -7 | -1 | 0 | 5 - 48 | 1 | -4 | -6 | -4 | 8 | 0 | 0 - 49 | 2 | -4 | -6 | -3 | 4 | 1 | 0 - 50 | 3 | -4 | -6 | 5000 | 25 | 0 | 1 - 51 | 4 | -4 | -6 | -12 | 21 | 1 | 1 - 52 | 5 | -4 | -6 | -20 | 46 | 0 | 2 - 53 | 6 | -4 | -6 | -18 | 40 | 1 | 2 - 54 | 7 | -4 | -6 | 9000 | 64 | 0 | 3 - 55 | 8 | -4 | -6 | -28 | 61 | 1 | 3 - 56 | 9 | -4 | -6 | 4000 | 17 | 0 | 4 - 57 | 10 | -4 | -6 | -8 | 15 | 1 | 4 - 58 | 11 | -4 | -6 | 3000 | 13 | 0 | 5 - 59 | 12 | -4 | -6 | -6 | -1 | 0 | 5 - 60 | 1 | -4 | 3000 | -4 | 8 | 0 | 0 - 61 | 2 | -4 | 3000 | -3 | 4 | 1 | 0 - 62 | 3 | -4 | 3000 | 5000 | 25 | 0 | 1 - 63 | 4 | -4 | 3000 | -12 | 21 | 1 | 1 - 64 | 5 | -4 | 3000 | -20 | 46 | 0 | 2 - 65 | 6 | -4 | 3000 | -18 | 40 | 1 | 2 - 66 | 7 | -4 | 3000 | 9000 | 64 | 0 | 3 - 67 | 8 | -4 | 3000 | -28 | 61 | 1 | 3 - 68 | 9 | -4 | 3000 | 4000 | 17 | 0 | 4 - 69 | 10 | -4 | 3000 | -8 | 15 | 1 | 4 - 70 | 11 | -4 | 3000 | 3000 | -1 | 0 | 5 - 71 | 1 | -3 | -7 | -3 | 4 | 1 | 0 - 72 | 2 | -3 | -7 | 5000 | 25 | 0 | 1 - 73 | 3 | -3 | -7 | -12 | 21 | 1 | 1 - 74 | 4 | -3 | -7 | -20 | 46 | 0 | 2 - 75 | 5 | -3 | -7 | -18 | 40 | 1 | 2 - 76 | 6 | -3 | -7 | 9000 | 64 | 0 | 3 - 77 | 7 | -3 | -7 | -28 | 61 | 1 | 3 - 78 | 8 | -3 | -7 | 4000 | 17 | 0 | 4 - 79 | 9 | -3 | -7 | -8 | 15 | 1 | 4 - 80 | 10 | -3 | -7 | 3000 | 14 | 0 | 5 - 81 | 11 | -3 | -7 | -7 | -1 | 0 | 5 - 82 | 1 | -3 | -6 | -3 | 4 | 1 | 0 - 83 | 2 | -3 | -6 | 5000 | 25 | 0 | 1 - 84 | 3 | -3 | -6 | -12 | 21 | 1 | 1 - 85 | 4 | -3 | -6 | -20 | 46 | 0 | 2 - 86 | 5 | -3 | -6 | -18 | 40 | 1 | 2 - 87 | 6 | -3 | -6 | 9000 | 64 | 0 | 3 - 88 | 7 | -3 | -6 | -28 | 61 | 1 | 3 - 89 | 8 | -3 | -6 | 4000 | 17 | 0 | 4 - 90 | 9 | -3 | -6 | -8 | 15 | 1 | 4 - 91 | 10 | -3 | -6 | 3000 | 13 | 0 | 5 - 92 | 11 | -3 | -6 | -6 | -1 | 0 | 5 - 93 | 1 | -3 | 3000 | -3 | 4 | 1 | 0 - 94 | 2 | -3 | 3000 | 5000 | 25 | 0 | 1 - 95 | 3 | -3 | 3000 | -12 | 21 | 1 | 1 - 96 | 4 | -3 | 3000 | -20 | 46 | 0 | 2 - 97 | 5 | -3 | 3000 | -18 | 40 | 1 | 2 - 98 | 6 | -3 | 3000 | 9000 | 64 | 0 | 3 - 99 | 7 | -3 | 3000 | -28 | 61 | 1 | 3 - 100 | 8 | -3 | 3000 | 4000 | 17 | 0 | 4 - 101 | 9 | -3 | 3000 | -8 | 15 | 1 | 4 - 102 | 10 | -3 | 3000 | 3000 | -1 | 0 | 5 - 103 | 1 | -2 | -7 | -2 | 3 | 1 | 0 - 104 | 2 | -2 | -7 | 1000 | 2 | 0 | 1 - 105 | 3 | -2 | -7 | -1 | 1 | 1 | 1 - 106 | 4 | -2 | -7 | 2000 | 6 | 0 | 2 - 107 | 5 | -2 | -7 | -3 | 4 | 1 | 2 - 108 | 6 | -2 | -7 | 5000 | 25 | 0 | 3 - 109 | 7 | -2 | -7 | -12 | 21 | 1 | 3 - 110 | 8 | -2 | -7 | -20 | 46 | 0 | 4 - 111 | 9 | -2 | -7 | -18 | 40 | 1 | 4 - 112 | 10 | -2 | -7 | 9000 | 64 | 0 | 5 - 113 | 11 | -2 | -7 | -28 | 61 | 1 | 5 - 114 | 12 | -2 | -7 | 4000 | 17 | 0 | 6 - 115 | 13 | -2 | -7 | -8 | 15 | 1 | 6 - 116 | 14 | -2 | -7 | 3000 | 14 | 0 | 7 - 117 | 15 | -2 | -7 | -7 | -1 | 0 | 7 - 118 | 1 | -2 | -6 | -2 | 3 | 1 | 0 - 119 | 2 | -2 | -6 | 1000 | 2 | 0 | 1 - 120 | 3 | -2 | -6 | -1 | 1 | 1 | 1 - 121 | 4 | -2 | -6 | 2000 | 6 | 0 | 2 - 122 | 5 | -2 | -6 | -3 | 4 | 1 | 2 - 123 | 6 | -2 | -6 | 5000 | 25 | 0 | 3 - 124 | 7 | -2 | -6 | -12 | 21 | 1 | 3 - 125 | 8 | -2 | -6 | -20 | 46 | 0 | 4 - 126 | 9 | -2 | -6 | -18 | 40 | 1 | 4 - 127 | 10 | -2 | -6 | 9000 | 64 | 0 | 5 - 128 | 11 | -2 | -6 | -28 | 61 | 1 | 5 - 129 | 12 | -2 | -6 | 4000 | 17 | 0 | 6 - 130 | 13 | -2 | -6 | -8 | 15 | 1 | 6 - 131 | 14 | -2 | -6 | 3000 | 13 | 0 | 7 - 132 | 15 | -2 | -6 | -6 | -1 | 0 | 7 - 133 | 1 | -2 | 3000 | -2 | 3 | 1 | 0 - 134 | 2 | -2 | 3000 | 1000 | 2 | 0 | 1 - 135 | 3 | -2 | 3000 | -1 | 1 | 1 | 1 - 136 | 4 | -2 | 3000 | 2000 | 6 | 0 | 2 - 137 | 5 | -2 | 3000 | -3 | 4 | 1 | 2 - 138 | 6 | -2 | 3000 | 5000 | 25 | 0 | 3 - 139 | 7 | -2 | 3000 | -12 | 21 | 1 | 3 - 140 | 8 | -2 | 3000 | -20 | 46 | 0 | 4 - 141 | 9 | -2 | 3000 | -18 | 40 | 1 | 4 - 142 | 10 | -2 | 3000 | 9000 | 64 | 0 | 5 - 143 | 11 | -2 | 3000 | -28 | 61 | 1 | 5 - 144 | 12 | -2 | 3000 | 4000 | 17 | 0 | 6 - 145 | 13 | -2 | 3000 | -8 | 15 | 1 | 6 - 146 | 14 | -2 | 3000 | 3000 | -1 | 0 | 7 - 147 | 1 | 2000 | -7 | 2000 | 6 | 0 | 0 - 148 | 2 | 2000 | -7 | -3 | 4 | 1 | 0 - 149 | 3 | 2000 | -7 | 5000 | 25 | 0 | 1 - 150 | 4 | 2000 | -7 | -12 | 21 | 1 | 1 - 151 | 5 | 2000 | -7 | -20 | 46 | 0 | 2 - 152 | 6 | 2000 | -7 | -18 | 40 | 1 | 2 - 153 | 7 | 2000 | -7 | 9000 | 64 | 0 | 3 - 154 | 8 | 2000 | -7 | -28 | 61 | 1 | 3 - 155 | 9 | 2000 | -7 | 4000 | 17 | 0 | 4 - 156 | 10 | 2000 | -7 | -8 | 15 | 1 | 4 - 157 | 11 | 2000 | -7 | 3000 | 14 | 0 | 5 - 158 | 12 | 2000 | -7 | -7 | -1 | 0 | 5 - 159 | 1 | 2000 | -6 | 2000 | 6 | 0 | 0 - 160 | 2 | 2000 | -6 | -3 | 4 | 1 | 0 - 161 | 3 | 2000 | -6 | 5000 | 25 | 0 | 1 - 162 | 4 | 2000 | -6 | -12 | 21 | 1 | 1 - 163 | 5 | 2000 | -6 | -20 | 46 | 0 | 2 - 164 | 6 | 2000 | -6 | -18 | 40 | 1 | 2 - 165 | 7 | 2000 | -6 | 9000 | 64 | 0 | 3 - 166 | 8 | 2000 | -6 | -28 | 61 | 1 | 3 - 167 | 9 | 2000 | -6 | 4000 | 17 | 0 | 4 - 168 | 10 | 2000 | -6 | -8 | 15 | 1 | 4 - 169 | 11 | 2000 | -6 | 3000 | 13 | 0 | 5 - 170 | 12 | 2000 | -6 | -6 | -1 | 0 | 5 - 171 | 1 | 2000 | 3000 | 2000 | 6 | 0 | 0 - 172 | 2 | 2000 | 3000 | -3 | 4 | 1 | 0 - 173 | 3 | 2000 | 3000 | 5000 | 25 | 0 | 1 - 174 | 4 | 2000 | 3000 | -12 | 21 | 1 | 1 - 175 | 5 | 2000 | 3000 | -20 | 46 | 0 | 2 - 176 | 6 | 2000 | 3000 | -18 | 40 | 1 | 2 - 177 | 7 | 2000 | 3000 | 9000 | 64 | 0 | 3 - 178 | 8 | 2000 | 3000 | -28 | 61 | 1 | 3 - 179 | 9 | 2000 | 3000 | 4000 | 17 | 0 | 4 - 180 | 10 | 2000 | 3000 | -8 | 15 | 1 | 4 - 181 | 11 | 2000 | 3000 | 3000 | -1 | 0 | 5 + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+-------+------+------+---------- + 1 | 1 | -5 | -7 | -5 | 10 | 0 | 0 + 2 | 2 | -5 | -7 | -3 | 4 | 1 | 0 + 3 | 3 | -5 | -7 | 7000 | 25 | 0 | 1 + 4 | 4 | -5 | -7 | -12 | 21 | 1 | 1 + 5 | 5 | -5 | -7 | -20 | 46 | 0 | 2 + 6 | 6 | -5 | -7 | -18 | 40 | 1 | 2 + 7 | 7 | -5 | -7 | 16000 | 64 | 0 | 3 + 8 | 8 | -5 | -7 | -28 | 61 | 1 | 3 + 9 | 9 | -5 | -7 | 15000 | 17 | 0 | 4 + 10 | 10 | -5 | -7 | -8 | 15 | 1 | 4 + 11 | 11 | -5 | -7 | 10000 | 14 | 0 | 5 + 12 | 12 | -5 | -7 | -7 | -1 | 0 | 5 + 13 | 1 | -5 | -6 | -5 | 10 | 0 | 0 + 14 | 2 | -5 | -6 | -3 | 4 | 1 | 0 + 15 | 3 | -5 | -6 | 7000 | 25 | 0 | 1 + 16 | 4 | -5 | -6 | -12 | 21 | 1 | 1 + 17 | 5 | -5 | -6 | -20 | 46 | 0 | 2 + 18 | 6 | -5 | -6 | -18 | 40 | 1 | 2 + 19 | 7 | -5 | -6 | 16000 | 64 | 0 | 3 + 20 | 8 | -5 | -6 | -28 | 61 | 1 | 3 + 21 | 9 | -5 | -6 | 15000 | 17 | 0 | 4 + 22 | 10 | -5 | -6 | -8 | 15 | 1 | 4 + 23 | 11 | -5 | -6 | 10000 | 13 | 0 | 5 + 24 | 12 | -5 | -6 | -6 | -1 | 0 | 5 + 25 | 1 | -5 | 10000 | -5 | 10 | 0 | 0 + 26 | 2 | -5 | 10000 | -3 | 4 | 1 | 0 + 27 | 3 | -5 | 10000 | 7000 | 25 | 0 | 1 + 28 | 4 | -5 | 10000 | -12 | 21 | 1 | 1 + 29 | 5 | -5 | 10000 | -20 | 46 | 0 | 2 + 30 | 6 | -5 | 10000 | -18 | 40 | 1 | 2 + 31 | 7 | -5 | 10000 | 16000 | 64 | 0 | 3 + 32 | 8 | -5 | 10000 | -28 | 61 | 1 | 3 + 33 | 9 | -5 | 10000 | 15000 | 17 | 0 | 4 + 34 | 10 | -5 | 10000 | -8 | 15 | 1 | 4 + 35 | 11 | -5 | 10000 | 10000 | -1 | 0 | 5 + 36 | 1 | -4 | -7 | -4 | 8 | 0 | 0 + 37 | 2 | -4 | -7 | -3 | 4 | 1 | 0 + 38 | 3 | -4 | -7 | 7000 | 25 | 0 | 1 + 39 | 4 | -4 | -7 | -12 | 21 | 1 | 1 + 40 | 5 | -4 | -7 | -20 | 46 | 0 | 2 + 41 | 6 | -4 | -7 | -18 | 40 | 1 | 2 + 42 | 7 | -4 | -7 | 16000 | 64 | 0 | 3 + 43 | 8 | -4 | -7 | -28 | 61 | 1 | 3 + 44 | 9 | -4 | -7 | 15000 | 17 | 0 | 4 + 45 | 10 | -4 | -7 | -8 | 15 | 1 | 4 + 46 | 11 | -4 | -7 | 10000 | 14 | 0 | 5 + 47 | 12 | -4 | -7 | -7 | -1 | 0 | 5 + 48 | 1 | -4 | -6 | -4 | 8 | 0 | 0 + 49 | 2 | -4 | -6 | -3 | 4 | 1 | 0 + 50 | 3 | -4 | -6 | 7000 | 25 | 0 | 1 + 51 | 4 | -4 | -6 | -12 | 21 | 1 | 1 + 52 | 5 | -4 | -6 | -20 | 46 | 0 | 2 + 53 | 6 | -4 | -6 | -18 | 40 | 1 | 2 + 54 | 7 | -4 | -6 | 16000 | 64 | 0 | 3 + 55 | 8 | -4 | -6 | -28 | 61 | 1 | 3 + 56 | 9 | -4 | -6 | 15000 | 17 | 0 | 4 + 57 | 10 | -4 | -6 | -8 | 15 | 1 | 4 + 58 | 11 | -4 | -6 | 10000 | 13 | 0 | 5 + 59 | 12 | -4 | -6 | -6 | -1 | 0 | 5 + 60 | 1 | -4 | 10000 | -4 | 8 | 0 | 0 + 61 | 2 | -4 | 10000 | -3 | 4 | 1 | 0 + 62 | 3 | -4 | 10000 | 7000 | 25 | 0 | 1 + 63 | 4 | -4 | 10000 | -12 | 21 | 1 | 1 + 64 | 5 | -4 | 10000 | -20 | 46 | 0 | 2 + 65 | 6 | -4 | 10000 | -18 | 40 | 1 | 2 + 66 | 7 | -4 | 10000 | 16000 | 64 | 0 | 3 + 67 | 8 | -4 | 10000 | -28 | 61 | 1 | 3 + 68 | 9 | -4 | 10000 | 15000 | 17 | 0 | 4 + 69 | 10 | -4 | 10000 | -8 | 15 | 1 | 4 + 70 | 11 | -4 | 10000 | 10000 | -1 | 0 | 5 + 71 | 1 | -3 | -7 | -3 | 4 | 1 | 0 + 72 | 2 | -3 | -7 | 7000 | 25 | 0 | 1 + 73 | 3 | -3 | -7 | -12 | 21 | 1 | 1 + 74 | 4 | -3 | -7 | -20 | 46 | 0 | 2 + 75 | 5 | -3 | -7 | -18 | 40 | 1 | 2 + 76 | 6 | -3 | -7 | 16000 | 64 | 0 | 3 + 77 | 7 | -3 | -7 | -28 | 61 | 1 | 3 + 78 | 8 | -3 | -7 | 15000 | 17 | 0 | 4 + 79 | 9 | -3 | -7 | -8 | 15 | 1 | 4 + 80 | 10 | -3 | -7 | 10000 | 14 | 0 | 5 + 81 | 11 | -3 | -7 | -7 | -1 | 0 | 5 + 82 | 1 | -3 | -6 | -3 | 4 | 1 | 0 + 83 | 2 | -3 | -6 | 7000 | 25 | 0 | 1 + 84 | 3 | -3 | -6 | -12 | 21 | 1 | 1 + 85 | 4 | -3 | -6 | -20 | 46 | 0 | 2 + 86 | 5 | -3 | -6 | -18 | 40 | 1 | 2 + 87 | 6 | -3 | -6 | 16000 | 64 | 0 | 3 + 88 | 7 | -3 | -6 | -28 | 61 | 1 | 3 + 89 | 8 | -3 | -6 | 15000 | 17 | 0 | 4 + 90 | 9 | -3 | -6 | -8 | 15 | 1 | 4 + 91 | 10 | -3 | -6 | 10000 | 13 | 0 | 5 + 92 | 11 | -3 | -6 | -6 | -1 | 0 | 5 + 93 | 1 | -3 | 10000 | -3 | 4 | 1 | 0 + 94 | 2 | -3 | 10000 | 7000 | 25 | 0 | 1 + 95 | 3 | -3 | 10000 | -12 | 21 | 1 | 1 + 96 | 4 | -3 | 10000 | -20 | 46 | 0 | 2 + 97 | 5 | -3 | 10000 | -18 | 40 | 1 | 2 + 98 | 6 | -3 | 10000 | 16000 | 64 | 0 | 3 + 99 | 7 | -3 | 10000 | -28 | 61 | 1 | 3 + 100 | 8 | -3 | 10000 | 15000 | 17 | 0 | 4 + 101 | 9 | -3 | 10000 | -8 | 15 | 1 | 4 + 102 | 10 | -3 | 10000 | 10000 | -1 | 0 | 5 + 103 | 1 | -2 | -7 | -2 | 3 | 1 | 0 + 104 | 2 | -2 | -7 | 5000 | 2 | 0 | 1 + 105 | 3 | -2 | -7 | -1 | 1 | 1 | 1 + 106 | 4 | -2 | -7 | 6000 | 6 | 0 | 2 + 107 | 5 | -2 | -7 | -3 | 4 | 1 | 2 + 108 | 6 | -2 | -7 | 7000 | 25 | 0 | 3 + 109 | 7 | -2 | -7 | -12 | 21 | 1 | 3 + 110 | 8 | -2 | -7 | -20 | 46 | 0 | 4 + 111 | 9 | -2 | -7 | -18 | 40 | 1 | 4 + 112 | 10 | -2 | -7 | 16000 | 64 | 0 | 5 + 113 | 11 | -2 | -7 | -28 | 61 | 1 | 5 + 114 | 12 | -2 | -7 | 15000 | 17 | 0 | 6 + 115 | 13 | -2 | -7 | -8 | 15 | 1 | 6 + 116 | 14 | -2 | -7 | 10000 | 14 | 0 | 7 + 117 | 15 | -2 | -7 | -7 | -1 | 0 | 7 + 118 | 1 | -2 | -6 | -2 | 3 | 1 | 0 + 119 | 2 | -2 | -6 | 5000 | 2 | 0 | 1 + 120 | 3 | -2 | -6 | -1 | 1 | 1 | 1 + 121 | 4 | -2 | -6 | 6000 | 6 | 0 | 2 + 122 | 5 | -2 | -6 | -3 | 4 | 1 | 2 + 123 | 6 | -2 | -6 | 7000 | 25 | 0 | 3 + 124 | 7 | -2 | -6 | -12 | 21 | 1 | 3 + 125 | 8 | -2 | -6 | -20 | 46 | 0 | 4 + 126 | 9 | -2 | -6 | -18 | 40 | 1 | 4 + 127 | 10 | -2 | -6 | 16000 | 64 | 0 | 5 + 128 | 11 | -2 | -6 | -28 | 61 | 1 | 5 + 129 | 12 | -2 | -6 | 15000 | 17 | 0 | 6 + 130 | 13 | -2 | -6 | -8 | 15 | 1 | 6 + 131 | 14 | -2 | -6 | 10000 | 13 | 0 | 7 + 132 | 15 | -2 | -6 | -6 | -1 | 0 | 7 + 133 | 1 | -2 | 10000 | -2 | 3 | 1 | 0 + 134 | 2 | -2 | 10000 | 5000 | 2 | 0 | 1 + 135 | 3 | -2 | 10000 | -1 | 1 | 1 | 1 + 136 | 4 | -2 | 10000 | 6000 | 6 | 0 | 2 + 137 | 5 | -2 | 10000 | -3 | 4 | 1 | 2 + 138 | 6 | -2 | 10000 | 7000 | 25 | 0 | 3 + 139 | 7 | -2 | 10000 | -12 | 21 | 1 | 3 + 140 | 8 | -2 | 10000 | -20 | 46 | 0 | 4 + 141 | 9 | -2 | 10000 | -18 | 40 | 1 | 4 + 142 | 10 | -2 | 10000 | 16000 | 64 | 0 | 5 + 143 | 11 | -2 | 10000 | -28 | 61 | 1 | 5 + 144 | 12 | -2 | 10000 | 15000 | 17 | 0 | 6 + 145 | 13 | -2 | 10000 | -8 | 15 | 1 | 6 + 146 | 14 | -2 | 10000 | 10000 | -1 | 0 | 7 + 147 | 1 | 6000 | -7 | 6000 | 6 | 0 | 0 + 148 | 2 | 6000 | -7 | -3 | 4 | 1 | 0 + 149 | 3 | 6000 | -7 | 7000 | 25 | 0 | 1 + 150 | 4 | 6000 | -7 | -12 | 21 | 1 | 1 + 151 | 5 | 6000 | -7 | -20 | 46 | 0 | 2 + 152 | 6 | 6000 | -7 | -18 | 40 | 1 | 2 + 153 | 7 | 6000 | -7 | 16000 | 64 | 0 | 3 + 154 | 8 | 6000 | -7 | -28 | 61 | 1 | 3 + 155 | 9 | 6000 | -7 | 15000 | 17 | 0 | 4 + 156 | 10 | 6000 | -7 | -8 | 15 | 1 | 4 + 157 | 11 | 6000 | -7 | 10000 | 14 | 0 | 5 + 158 | 12 | 6000 | -7 | -7 | -1 | 0 | 5 + 159 | 1 | 6000 | -6 | 6000 | 6 | 0 | 0 + 160 | 2 | 6000 | -6 | -3 | 4 | 1 | 0 + 161 | 3 | 6000 | -6 | 7000 | 25 | 0 | 1 + 162 | 4 | 6000 | -6 | -12 | 21 | 1 | 1 + 163 | 5 | 6000 | -6 | -20 | 46 | 0 | 2 + 164 | 6 | 6000 | -6 | -18 | 40 | 1 | 2 + 165 | 7 | 6000 | -6 | 16000 | 64 | 0 | 3 + 166 | 8 | 6000 | -6 | -28 | 61 | 1 | 3 + 167 | 9 | 6000 | -6 | 15000 | 17 | 0 | 4 + 168 | 10 | 6000 | -6 | -8 | 15 | 1 | 4 + 169 | 11 | 6000 | -6 | 10000 | 13 | 0 | 5 + 170 | 12 | 6000 | -6 | -6 | -1 | 0 | 5 + 171 | 1 | 6000 | 10000 | 6000 | 6 | 0 | 0 + 172 | 2 | 6000 | 10000 | -3 | 4 | 1 | 0 + 173 | 3 | 6000 | 10000 | 7000 | 25 | 0 | 1 + 174 | 4 | 6000 | 10000 | -12 | 21 | 1 | 1 + 175 | 5 | 6000 | 10000 | -20 | 46 | 0 | 2 + 176 | 6 | 6000 | 10000 | -18 | 40 | 1 | 2 + 177 | 7 | 6000 | 10000 | 16000 | 64 | 0 | 3 + 178 | 8 | 6000 | 10000 | -28 | 61 | 1 | 3 + 179 | 9 | 6000 | 10000 | 15000 | 17 | 0 | 4 + 180 | 10 | 6000 | 10000 | -8 | 15 | 1 | 4 + 181 | 11 | 6000 | 10000 | 10000 | -1 | 0 | 5 (181 rows) SELECT min(agg_cost) FROM q_result_1 WHERE edge = -1; @@ -546,47 +537,47 @@ SELECT path_seq, start_vid, end_vid FROM q_result_1 WHERE edge = -1 and agg_cost ----------+-----------+--------- 12 | -5 | -7 12 | -5 | -6 - 11 | -5 | 3000 + 11 | -5 | 10000 12 | -4 | -7 12 | -4 | -6 - 11 | -4 | 3000 + 11 | -4 | 10000 11 | -3 | -7 11 | -3 | -6 - 10 | -3 | 3000 - 12 | 2000 | -7 - 12 | 2000 | -6 - 11 | 2000 | 3000 + 10 | -3 | 10000 + 12 | 6000 | -7 + 12 | 6000 | -6 + 11 | 6000 | 10000 (12 rows) -SELECT * FROM q_result_1 WHERE start_vid = -3 AND end_vid = 3000; - seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+----------+-----------+---------+------+------+------+---------- - 93 | 1 | -3 | 3000 | -3 | 4 | 1 | 0 - 94 | 2 | -3 | 3000 | 5000 | 25 | 0 | 1 - 95 | 3 | -3 | 3000 | -12 | 21 | 1 | 1 - 96 | 4 | -3 | 3000 | -20 | 46 | 0 | 2 - 97 | 5 | -3 | 3000 | -18 | 40 | 1 | 2 - 98 | 6 | -3 | 3000 | 9000 | 64 | 0 | 3 - 99 | 7 | -3 | 3000 | -28 | 61 | 1 | 3 - 100 | 8 | -3 | 3000 | 4000 | 17 | 0 | 4 - 101 | 9 | -3 | 3000 | -8 | 15 | 1 | 4 - 102 | 10 | -3 | 3000 | 3000 | -1 | 0 | 5 +SELECT * FROM q_result_1 WHERE start_vid = -3 AND end_vid = 10000; + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+-------+------+------+---------- + 93 | 1 | -3 | 10000 | -3 | 4 | 1 | 0 + 94 | 2 | -3 | 10000 | 7000 | 25 | 0 | 1 + 95 | 3 | -3 | 10000 | -12 | 21 | 1 | 1 + 96 | 4 | -3 | 10000 | -20 | 46 | 0 | 2 + 97 | 5 | -3 | 10000 | -18 | 40 | 1 | 2 + 98 | 6 | -3 | 10000 | 16000 | 64 | 0 | 3 + 99 | 7 | -3 | 10000 | -28 | 61 | 1 | 3 + 100 | 8 | -3 | 10000 | 15000 | 17 | 0 | 4 + 101 | 9 | -3 | 10000 | -8 | 15 | 1 | 4 + 102 | 10 | -3 | 10000 | 10000 | -1 | 0 | 5 (10 rows) -SELECT * FROM q_result_1 WHERE start_vid = -3 AND end_vid = 3000 AND (cost != 0 OR edge = -1); - seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+----------+-----------+---------+------+------+------+---------- - 93 | 1 | -3 | 3000 | -3 | 4 | 1 | 0 - 95 | 3 | -3 | 3000 | -12 | 21 | 1 | 1 - 97 | 5 | -3 | 3000 | -18 | 40 | 1 | 2 - 99 | 7 | -3 | 3000 | -28 | 61 | 1 | 3 - 101 | 9 | -3 | 3000 | -8 | 15 | 1 | 4 - 102 | 10 | -3 | 3000 | 3000 | -1 | 0 | 5 +SELECT * FROM q_result_1 WHERE start_vid = -3 AND end_vid = 10000 AND (cost != 0 OR edge = -1); + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+-------+------+------+---------- + 93 | 1 | -3 | 10000 | -3 | 4 | 1 | 0 + 95 | 3 | -3 | 10000 | -12 | 21 | 1 | 1 + 97 | 5 | -3 | 10000 | -18 | 40 | 1 | 2 + 99 | 7 | -3 | 10000 | -28 | 61 | 1 | 3 + 101 | 9 | -3 | 10000 | -8 | 15 | 1 | 4 + 102 | 10 | -3 | 10000 | 10000 | -1 | 0 | 5 (6 rows) WITH a AS ( SELECT * FROM q_result_1 - WHERE start_vid = -3 AND end_vid = 3000 AND (cost != 0 OR edge = -1)) + WHERE start_vid = -3 AND end_vid = 10000 AND (cost != 0 OR edge = -1)) SELECT a.seq, a.path_seq, (SELECT original_id FROM result2_vertices_pgr AS b WHERE a.start_vid = b.id) AS start_vid, @@ -594,26 +585,26 @@ SELECT (SELECT original_id FROM result2_vertices_pgr AS b WHERE a.node = b.id) AS node, edge, cost, agg_cost FROM a; - seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+----------+-----------+---------+------+------+------+---------- - 93 | 1 | 2000 | 3000 | 2000 | 4 | 1 | 0 - 95 | 3 | 2000 | 3000 | 5000 | 21 | 1 | 1 - 97 | 5 | 2000 | 3000 | 6000 | 40 | 1 | 2 - 99 | 7 | 2000 | 3000 | 9000 | 61 | 1 | 3 - 101 | 9 | 2000 | 3000 | 4000 | 15 | 1 | 4 - 102 | 10 | 2000 | 3000 | 3000 | -1 | 0 | 5 + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+-------+------+------+---------- + 93 | 1 | 6000 | 10000 | 6000 | 4 | 1 | 0 + 95 | 3 | 6000 | 10000 | 7000 | 21 | 1 | 1 + 97 | 5 | 6000 | 10000 | 11000 | 40 | 1 | 2 + 99 | 7 | 6000 | 10000 | 16000 | 61 | 1 | 3 + 101 | 9 | 6000 | 10000 | 15000 | 15 | 1 | 4 + 102 | 10 | 6000 | 10000 | 10000 | -1 | 0 | 5 (6 rows) SELECT * from pgr_dijkstra($$SELECT id, * FROM edges1$$, - ARRAY[2000], ARRAY[3000]); - seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost ------+----------+-----------+---------+------+------+------+---------- - 1 | 1 | 2000 | 3000 | 2000 | 400 | 1 | 0 - 2 | 2 | 2000 | 3000 | 5000 | 800 | 1 | 1 - 3 | 3 | 2000 | 3000 | 6000 | 900 | 1 | 2 - 4 | 4 | 2000 | 3000 | 9000 | 1600 | 1 | 3 - 5 | 5 | 2000 | 3000 | 4000 | 300 | 1 | 4 - 6 | 6 | 2000 | 3000 | 3000 | -1 | 0 | 5 + ARRAY[6000], ARRAY[10000]); + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+-------+------+------+---------- + 1 | 1 | 6000 | 10000 | 6000 | 400 | 1 | 0 + 2 | 2 | 6000 | 10000 | 7000 | 800 | 1 | 1 + 3 | 3 | 6000 | 10000 | 11000 | 900 | 1 | 2 + 4 | 4 | 6000 | 10000 | 16000 | 1600 | 1 | 3 + 5 | 5 | 6000 | 10000 | 15000 | 300 | 1 | 4 + 6 | 6 | 6000 | 10000 | 10000 | -1 | 0 | 5 (6 rows) ROLLBACK; diff --git a/docqueries/src/concepts.pg b/docqueries/src/concepts.pg index 3ea5eae5073..bc8ec3e47fd 100644 --- a/docqueries/src/concepts.pg +++ b/docqueries/src/concepts.pg @@ -256,3 +256,20 @@ SELECT * FROM pgr_dijkstra($$ FROM edges WHERE id = 6)$$, 7, 8); /* -- performance3 */ + +DROP TABLE IF EXISTS vertices; +/* -- createTopology1 */ +SELECT * INTO vertices +FROM pgr_extractVertices('SELECT id, geom FROM edges ORDER BY id'); +/* -- createTopology2 */ +/* -- set the source information */ +UPDATE edges AS e +SET source = v.id, x1 = x, y1 = y +FROM vertices AS v +WHERE ST_StartPoint(e.geom) = v.geom; +/* -- set the target information */ +UPDATE edges AS e +SET target = v.id, x2 = x, y2 = y +FROM vertices AS v +WHERE ST_EndPoint(e.geom) = v.geom; +/* -- createTopology3 */ diff --git a/docqueries/src/concepts.result b/docqueries/src/concepts.result index 39b66bb980b..eedf1db5264 100644 --- a/docqueries/src/concepts.result +++ b/docqueries/src/concepts.result @@ -448,5 +448,25 @@ SELECT * FROM pgr_dijkstra($$ (2 rows) /* -- performance3 */ +DROP TABLE IF EXISTS vertices; +DROP TABLE +/* -- createTopology1 */ +SELECT * INTO vertices +FROM pgr_extractVertices('SELECT id, geom FROM edges ORDER BY id'); +SELECT 18 +/* -- createTopology2 */ +/* -- set the source information */ +UPDATE edges AS e +SET source = v.id, x1 = x, y1 = y +FROM vertices AS v +WHERE ST_StartPoint(e.geom) = v.geom; +UPDATE 22 +/* -- set the target information */ +UPDATE edges AS e +SET target = v.id, x2 = x, y2 = y +FROM vertices AS v +WHERE ST_EndPoint(e.geom) = v.geom; +UPDATE 22 +/* -- createTopology3 */ ROLLBACK; ROLLBACK diff --git a/docqueries/topology/analyzeGraph.pg b/docqueries/topology/analyzeGraph.pg index 68bf238e0b6..c6a29150999 100644 --- a/docqueries/topology/analyzeGraph.pg +++ b/docqueries/topology/analyzeGraph.pg @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------------------------------ /* -- q1 */ -SELECT pgr_createTopology('edges',0.001, 'geom', clean := true); +SELECT id, geom AS the_geom, 0 AS cnt, 0 AS chk INTO edges_vertices_pgr FROM vertices; SELECT pgr_analyzeGraph('edges',0.001,'geom'); /* -- q1.1 */ @@ -46,7 +46,7 @@ SELECT pgr_analyzeGraph('edges',0.001, 'geom', rows_where:='geom && (SELECT st_ /* -- q12 */ CREATE TABLE mytable AS (SELECT id AS gid, source AS src ,target AS tgt , geom AS mygeom FROM edges); -SELECT pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt', clean := true); +SELECT id, geom AS the_geom, 0 AS cnt, 0 AS chk INTO mytable_vertices_pgr FROM vertices; /* -- q12.1 */ /* -- q13 */ @@ -96,7 +96,7 @@ SELECT pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',t /* -- q22.1 */ /* -- q23 */ -SELECT pgr_createTopology('edges',0.001, 'geom', clean := true); +UPDATE edges_vertices_pgr SET (cnt,chk) = (0,0); SELECT pgr_analyzeGraph('edges', 0.001, 'geom'); /* -- q23.1 */ @@ -114,7 +114,8 @@ SELECT pgr_analyzeGraph('edges',0.001,'geom', rows_where:='id < 17'); /* -- q27 */ -SELECT pgr_createTopology('edges', 0.001,'geom', rows_where:='id <17', clean := true); +DELETE FROM edges WHERE id >= 17; +UPDATE edges_vertices_pgr SET (cnt,chk) = (0,0); /* -- q27.1 */ /* -- q28 */ diff --git a/docqueries/topology/analyzeGraph.result b/docqueries/topology/analyzeGraph.result index 52502548257..7705686f10f 100644 --- a/docqueries/topology/analyzeGraph.result +++ b/docqueries/topology/analyzeGraph.result @@ -3,20 +3,8 @@ BEGIN SET client_min_messages TO NOTICE; SET /* -- q1 */ -SELECT pgr_createTopology('edges',0.001, 'geom', clean := true); -NOTICE: PROCESSING: -NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'true', clean := t) -NOTICE: Performing checks, please wait ..... -NOTICE: Creating Topology, Please wait... -NOTICE: -------------> TOPOLOGY CREATED FOR 18 edges -NOTICE: Rows with NULL geometry or NULL id: 0 -NOTICE: Vertices table for table public.edges is: public.edges_vertices_pgr -NOTICE: ---------------------------------------------- - pgr_createtopology --------------------- - OK -(1 row) - +SELECT id, geom AS the_geom, 0 AS cnt, 0 AS chk INTO edges_vertices_pgr FROM vertices; +SELECT 17 SELECT pgr_analyzeGraph('edges',0.001,'geom'); WARNING: pgr_analyzegraph(text,double precision,text,text,text,text,text) deprecated function on v3.8.0 NOTICE: PROCESSING: @@ -211,20 +199,8 @@ NOTICE: Ring geometries: 0 /* -- q12 */ CREATE TABLE mytable AS (SELECT id AS gid, source AS src ,target AS tgt , geom AS mygeom FROM edges); SELECT 18 -SELECT pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt', clean := true); -NOTICE: PROCESSING: -NOTICE: pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', rows_where := 'true', clean := t) -NOTICE: Performing checks, please wait ..... -NOTICE: Creating Topology, Please wait... -NOTICE: -------------> TOPOLOGY CREATED FOR 18 edges -NOTICE: Rows with NULL geometry or NULL id: 0 -NOTICE: Vertices table for table public.mytable is: public.mytable_vertices_pgr -NOTICE: ---------------------------------------------- - pgr_createtopology --------------------- - OK -(1 row) - +SELECT id, geom AS the_geom, 0 AS cnt, 0 AS chk INTO mytable_vertices_pgr FROM vertices; +SELECT 17 /* -- q12.1 */ /* -- q13 */ SELECT pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt'); @@ -456,20 +432,8 @@ NOTICE: Ring geometries: 0 /* -- q22.1 */ /* -- q23 */ -SELECT pgr_createTopology('edges',0.001, 'geom', clean := true); -NOTICE: PROCESSING: -NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'true', clean := t) -NOTICE: Performing checks, please wait ..... -NOTICE: Creating Topology, Please wait... -NOTICE: -------------> TOPOLOGY CREATED FOR 18 edges -NOTICE: Rows with NULL geometry or NULL id: 0 -NOTICE: Vertices table for table public.edges is: public.edges_vertices_pgr -NOTICE: ---------------------------------------------- - pgr_createtopology --------------------- - OK -(1 row) - +UPDATE edges_vertices_pgr SET (cnt,chk) = (0,0); +UPDATE 17 SELECT pgr_analyzeGraph('edges', 0.001, 'geom'); WARNING: pgr_analyzegraph(text,double precision,text,text,text,text,text) deprecated function on v3.8.0 NOTICE: PROCESSING: @@ -562,20 +526,10 @@ NOTICE: Ring geometries: 0 /* -- q26.1 */ /* -- q27 */ -SELECT pgr_createTopology('edges', 0.001,'geom', rows_where:='id <17', clean := true); -NOTICE: PROCESSING: -NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'id <17', clean := t) -NOTICE: Performing checks, please wait ..... -NOTICE: Creating Topology, Please wait... -NOTICE: -------------> TOPOLOGY CREATED FOR 16 edges -NOTICE: Rows with NULL geometry or NULL id: 0 -NOTICE: Vertices table for table public.edges is: public.edges_vertices_pgr -NOTICE: ---------------------------------------------- - pgr_createtopology --------------------- - OK -(1 row) - +DELETE FROM edges WHERE id >= 17; +DELETE 2 +UPDATE edges_vertices_pgr SET (cnt,chk) = (0,0); +UPDATE 17 /* -- q27.1 */ /* -- q28 */ SELECT pgr_analyzeGraph('edges', 0.001, 'geom'); diff --git a/docqueries/topology/analyzeOneWay.pg b/docqueries/topology/analyzeOneWay.pg index 5e1f17ce603..f3985e7de64 100644 --- a/docqueries/topology/analyzeOneWay.pg +++ b/docqueries/topology/analyzeOneWay.pg @@ -2,7 +2,7 @@ -- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/ /* --q1 */ ALTER TABLE edges ADD COLUMN dir TEXT; -SELECT pgr_createTopology('edges', 0.001, 'geom'); +SELECT *, NULL::INTEGER ein, NULL::INTEGER eout INTO edges_vertices_pgr FROM vertices; UPDATE edges SET dir = CASE WHEN (cost>0 AND reverse_cost>0) THEN 'B' /* both ways */ WHEN (cost>0 AND reverse_cost<0) THEN 'FT' /* direction of the LINESSTRING */ diff --git a/docqueries/topology/analyzeOneWay.result b/docqueries/topology/analyzeOneWay.result index ad77e50c1ed..20420a9909b 100644 --- a/docqueries/topology/analyzeOneWay.result +++ b/docqueries/topology/analyzeOneWay.result @@ -5,20 +5,8 @@ SET /* --q1 */ ALTER TABLE edges ADD COLUMN dir TEXT; ALTER TABLE -SELECT pgr_createTopology('edges', 0.001, 'geom'); -NOTICE: PROCESSING: -NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'true', clean := f) -NOTICE: Performing checks, please wait ..... -NOTICE: Creating Topology, Please wait... -NOTICE: -------------> TOPOLOGY CREATED FOR 0 edges -NOTICE: Rows with NULL geometry or NULL id: 0 -NOTICE: Vertices table for table public.edges is: public.edges_vertices_pgr -NOTICE: ---------------------------------------------- - pgr_createtopology --------------------- - OK -(1 row) - +SELECT *, NULL::INTEGER ein, NULL::INTEGER eout INTO edges_vertices_pgr FROM vertices; +SELECT 17 UPDATE edges SET dir = CASE WHEN (cost>0 AND reverse_cost>0) THEN 'B' /* both ways */ WHEN (cost>0 AND reverse_cost<0) THEN 'FT' /* direction of the LINESSTRING */ diff --git a/docqueries/topology/createTopology.result b/docqueries/topology/createTopology.result index b0d53b52c58..f9bc7720fed 100644 --- a/docqueries/topology/createTopology.result +++ b/docqueries/topology/createTopology.result @@ -6,6 +6,7 @@ UPDATE edges SET source = NULL, target = NULL; UPDATE 18 /* --q1 */ SELECT pgr_createTopology('edges', 0.001, 'geom'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 NOTICE: PROCESSING: NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'true', clean := f) NOTICE: Performing checks, please wait ..... @@ -25,6 +26,7 @@ UPDATE 18 /* --q2 */ SELECT pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 NOTICE: PROCESSING: NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'true', clean := f) NOTICE: Performing checks, please wait ..... @@ -44,6 +46,7 @@ SET /* --q3 */ SELECT pgr_createTopology('edges', 0.001, 'id', 'geom'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 NOTICE: PROCESSING: NOTICE: pgr_createTopology('edges', 0.001, 'id', 'geom', 'source', 'target', rows_where := 'true', clean := f) NOTICE: Performing checks, please wait ..... @@ -65,6 +68,7 @@ UPDATE 18 /* --q4 */ SELECT pgr_createTopology('edges', 0.001, the_geom:='geom', id:='id', source:='source', target:='target'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -78,6 +82,7 @@ UPDATE 18 /* --q5 */ SELECT pgr_createTopology('edges', 0.001, source:='source', id:='id', target:='target', the_geom:='geom'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -90,6 +95,7 @@ UPDATE edges SET source = NULL, target = NULL; UPDATE 18 /* --q6 */ SELECT pgr_createTopology('edges', 0.001, 'geom', source:='source'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -98,6 +104,7 @@ SELECT pgr_createTopology('edges', 0.001, 'geom', source:='source'); /* --q6.1 */ /* --q7 */ SELECT pgr_createTopology('edges', 0.001, 'geom', rows_where:='id < 10'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -107,6 +114,7 @@ SELECT pgr_createTopology('edges', 0.001, 'geom', rows_where:='id < 10'); /* --q8 */ SELECT pgr_createTopology('edges', 0.001, 'geom', rows_where:='geom && (SELECT st_buffer(geom, 0.05) FROM edges WHERE id=5)'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -118,6 +126,7 @@ CREATE TABLE otherTable AS (SELECT 100 AS gid, st_point(2.5, 2.5) AS other_geo SELECT 1 SELECT pgr_createTopology('edges', 0.001, 'geom', rows_where:='geom && (SELECT st_buffer(other_geom, 1) FROM otherTable WHERE gid=100)'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -130,6 +139,7 @@ SELECT 18 /* --q10.1 */ /* --q11 */ SELECT pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', clean := TRUE); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -144,6 +154,7 @@ SET client_min_messages TO NOTICE; SET /* --q12 */ SELECT pgr_createTopology('mytable', 0.001, 'gid', 'mygeom', 'src', 'tgt'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 NOTICE: PROCESSING: NOTICE: pgr_createTopology('mytable', 0.001, 'gid', 'mygeom', 'src', 'tgt', rows_where := 'true', clean := f) NOTICE: Performing checks, please wait ..... @@ -160,6 +171,7 @@ SET client_min_messages TO WARNING; SET /* --q13 */ SELECT pgr_createTopology('mytable', 0.001, the_geom:='mygeom', id:='gid', source:='src', target:='tgt'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -172,6 +184,7 @@ UPDATE mytable SET src = NULL, tgt = NULL; UPDATE 18 /* --q14 */ SELECT pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -180,12 +193,14 @@ SELECT pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:=' /* --q14.1 */ /* --q15 */ SELECT pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', rows_where:='gid < 10'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK (1 row) SELECT pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom', rows_where:='gid < 10'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -193,6 +208,7 @@ SELECT pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:=' SELECT pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', rows_where:='mygeom && (SELECT st_buffer(mygeom, 1) FROM mytable WHERE gid=5)'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -200,6 +216,7 @@ SELECT pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', SELECT pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom', rows_where:='mygeom && (SELECT st_buffer(mygeom, 1) FROM mytable WHERE gid=5)'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -209,6 +226,7 @@ SELECT pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:=' /* --q16 */ SELECT pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', rows_where:='mygeom && (SELECT st_buffer(other_geom, 1) FROM otherTable WHERE gid=100)'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -216,6 +234,7 @@ SELECT pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', SELECT pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom', rows_where:='mygeom && (SELECT st_buffer(other_geom, 1) FROM otherTable WHERE gid=100)'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 pgr_createtopology -------------------- OK @@ -226,6 +245,7 @@ SET client_min_messages TO NOTICE; SET /* --q17 */ SELECT pgr_createTopology('edges', 0.001, 'geom', rows_where:='id < 6', clean := true); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 NOTICE: PROCESSING: NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'id < 6', clean := t) NOTICE: Performing checks, please wait ..... @@ -240,6 +260,7 @@ NOTICE: ---------------------------------------------- (1 row) SELECT pgr_createTopology('edges', 0.001, 'geom'); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 NOTICE: PROCESSING: NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'true', clean := f) NOTICE: Performing checks, please wait ..... diff --git a/docqueries/topology/issue900.result b/docqueries/topology/issue900.result index bf03f30a166..2d3427bd970 100644 --- a/docqueries/topology/issue900.result +++ b/docqueries/topology/issue900.result @@ -8,6 +8,7 @@ CREATE TABLE edges AS SELECT * FROM mbta_arc; SELECT 18 ; SELECT pgr_CreateTopology('edges', 0.001, 'geom', 'id', clean := true); +WARNING: pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0 NOTICE: PROCESSING: NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'true', clean := t) NOTICE: Performing checks, please wait ..... diff --git a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po index 2a86cba9557..3201190709a 100644 --- a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po +++ b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgRouting v3.8\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-08 12:57+0000\n" +"POT-Creation-Date: 2025-04-08 17:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3969,6 +3969,11 @@ msgid "" "pgr_analyzeGraph" msgstr "" +msgid "" +"`#2750 `__: " +"pgr_createTopology" +msgstr "" + msgid "" "`#2826 `__: " "pgr_createVerticesTable" @@ -4052,7 +4057,7 @@ msgstr "" msgid "All deprecated functions will be removed on next major version 4.0.0" msgstr "" -msgid "Migration of ``pgr_createVerticesTable``" +msgid "Migration of ``pgr_createTopology``" msgstr "" msgid "" @@ -4066,6 +4071,59 @@ msgstr "" msgid "A table with `_vertices_pgr` was created." msgstr "" +msgid "" +"**After Deprecation:** The user is responsible to create the complete " +"topology." +msgstr "" + +msgid "Build a routing topology" +msgstr "" + +msgid "" +"The basic information to use the majority of the pgRouting functions " +"``id, source, target, cost, [reverse_cost]`` is what in pgRouting is " +"called the routing topology." +msgstr "" + +msgid "" +"``reverse_cost`` is optional but strongly recommended to have in order to" +" reduce the size of the database due to the size of the geometry columns." +" Having said that, in this documentation ``reverse_cost`` is used in this" +" documentation." +msgstr "" + +msgid "" +"When the data comes with geometries and there is no routing topology, " +"then this step is needed." +msgstr "" + +msgid "" +"All the start and end vertices of the geometries need an identifier that " +"is to be stored in a ``source`` and ``target`` columns of the table of " +"the data. Likewise, ``cost`` and ``reverse_cost`` need to have the value " +"of traversing the edge in both directions." +msgstr "" + +msgid "" +"If the columns do not exist they need to be added to the table in " +"question. (see `ALTER TABLE `__)" +msgstr "" + +msgid "" +"The function :doc:`pgr_extractVertices` is used to create a vertices " +"table based on the edge identifier and the geometry of the edge of the " +"graph." +msgstr "" + +msgid "" +"Finally using the data stored on the vertices tables the ``source`` and " +"``target`` are filled up." +msgstr "" + +msgid "Migration of ``pgr_createVerticesTable``" +msgstr "" + msgid "" "**After Deprecation:** The user is responsible to create the vertices " "table, indexes, etc. They may use :doc:`pgr_extractVertices` for that " @@ -5550,54 +5608,6 @@ msgid "" "documentation and the `PostGIS `__ documentation." msgstr "" -msgid "Build a routing topology" -msgstr "" - -msgid "" -"The basic information to use the majority of the pgRouting functions " -"``id, source, target, cost, [reverse_cost]`` is what in pgRouting is " -"called the routing topology." -msgstr "" - -msgid "" -"``reverse_cost`` is optional but strongly recommended to have in order to" -" reduce the size of the database due to the size of the geometry columns." -" Having said that, in this documentation ``reverse_cost`` is used in this" -" documentation." -msgstr "" - -msgid "" -"When the data comes with geometries and there is no routing topology, " -"then this step is needed." -msgstr "" - -msgid "" -"All the start and end vertices of the geometries need an identifier that " -"is to be stored in a ``source`` and ``target`` columns of the table of " -"the data. Likewise, ``cost`` and ``reverse_cost`` need to have the value " -"of traversing the edge in both directions." -msgstr "" - -msgid "" -"If the columns do not exist they need to be added to the table in " -"question. (see `ALTER TABLE `__)" -msgstr "" - -msgid "" -"The function :doc:`pgr_extractVertices` is used to create a vertices " -"table based on the edge identifier and the geometry of the edge of the " -"graph." -msgstr "" - -msgid "" -"Finally using the data stored on the vertices tables the ``source`` and " -"``target`` are filled up." -msgstr "" - -msgid "See :doc:`sampledata` for an example for building a topology." -msgstr "" - msgid "" "Data coming from OSM and using `osm2pgrouting " "`__ as an import tool, comes " @@ -7952,11 +7962,6 @@ msgid "" "vertices information." msgstr "" -msgid "" -"Use :doc:`pgr_createTopology` to create the topology and the vertices " -"table." -msgstr "" - msgid "The analyze graph function accepts the following parameters:" msgstr "" @@ -8043,11 +8048,6 @@ msgstr "" msgid "The Vertices Table" msgstr "" -msgid "" -"The vertices table can be created with :doc:`pgr_createTopology " -"`" -msgstr "" - msgid "The structure of the vertices table is:" msgstr "" @@ -8276,11 +8276,6 @@ msgid "" "value is ``true``." msgstr "" -msgid "" -"It is strongly recommended to use the named notation. See " -":doc:`pgr_createTopology` for examples." -msgstr "" - msgid "Fills completely the ``ein`` and ``eout`` columns of the vertices table." msgstr "" @@ -8293,9 +8288,6 @@ msgid "" "**in** or **out** condition." msgstr "" -msgid "The vertices table can be created with :doc:`pgr_createTopology`" -msgstr "" - msgid "``pgr_articulationPoints``" msgstr "" @@ -9657,9 +9649,6 @@ msgstr "" msgid "Node :math:`3` is a dead end node after node :math:`1` is contracted." msgstr "" -msgid "``forbidden_vertices``" -msgstr "" - msgid "``ARRAY[`` |ANY-INTEGER| ``]``" msgstr "" @@ -9960,7 +9949,7 @@ msgstr "" msgid "Create the contracted graph." msgstr "" -msgid "``pgr_createTopology``" +msgid "``pgr_createTopology`` - Deprecated since v3.8.0" msgstr "" msgid "" @@ -10276,11 +10265,6 @@ msgid "" "algorithms." msgstr "" -msgid "" -":doc:`pgr_createTopology` ` to create a topology " -"based on the geometry." -msgstr "" - msgid "``pgr_cuthillMckeeOrdering`` - Experimental" msgstr "" @@ -13194,9 +13178,6 @@ msgid "" "returned." msgstr "" -msgid "There is no flow when source has the same vaule as target." -msgstr "" - msgid "Uses the :doc:`pgr_pushRelabel ` algorithm." msgstr "" @@ -13401,14 +13382,10 @@ msgstr "" msgid "``integer`` Segment number of the original edge" msgstr "" -msgid "" -"``integer`` Empty source column to be used with :doc:`pgr_createTopology`" -" function" +msgid "``integer`` Empty source column" msgstr "" -msgid "" -"``integer`` Empty target column to be used with :doc:`pgr_createTopology`" -" function" +msgid "``integer`` Empty target column" msgstr "" msgid "the geom" @@ -13475,12 +13452,6 @@ msgid "" "segmented." msgstr "" -msgid "" -":doc:`topology-functions` for an overview of a topology for routing " -"algorithms. :doc:`pgr_createTopology` to create a topology based on the " -"geometry." -msgstr "" - msgid "``pgr_pickDeliver`` - Experimental" msgstr "" diff --git a/locale/pot/pgrouting_doc_strings.pot b/locale/pot/pgrouting_doc_strings.pot index 728737c8b06..aea26c935b0 100644 --- a/locale/pot/pgrouting_doc_strings.pot +++ b/locale/pot/pgrouting_doc_strings.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgRouting v3.8\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-08 12:57+0000\n" +"POT-Creation-Date: 2025-04-08 17:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3556,6 +3556,9 @@ msgstr "" msgid "`#2753 `__: pgr_analyzeGraph" msgstr "" +msgid "`#2750 `__: pgr_createTopology" +msgstr "" + msgid "`#2826 `__: pgr_createVerticesTable" msgstr "" @@ -3622,7 +3625,7 @@ msgstr "" msgid "All deprecated functions will be removed on next major version 4.0.0" msgstr "" -msgid "Migration of ``pgr_createVerticesTable``" +msgid "Migration of ``pgr_createTopology``" msgstr "" msgid "Starting from `v3.8.0 `__" @@ -3634,6 +3637,36 @@ msgstr "" msgid "A table with `_vertices_pgr` was created." msgstr "" +msgid "**After Deprecation:** The user is responsible to create the complete topology." +msgstr "" + +msgid "Build a routing topology" +msgstr "" + +msgid "The basic information to use the majority of the pgRouting functions ``id, source, target, cost, [reverse_cost]`` is what in pgRouting is called the routing topology." +msgstr "" + +msgid "``reverse_cost`` is optional but strongly recommended to have in order to reduce the size of the database due to the size of the geometry columns. Having said that, in this documentation ``reverse_cost`` is used in this documentation." +msgstr "" + +msgid "When the data comes with geometries and there is no routing topology, then this step is needed." +msgstr "" + +msgid "All the start and end vertices of the geometries need an identifier that is to be stored in a ``source`` and ``target`` columns of the table of the data. Likewise, ``cost`` and ``reverse_cost`` need to have the value of traversing the edge in both directions." +msgstr "" + +msgid "If the columns do not exist they need to be added to the table in question. (see `ALTER TABLE `__)" +msgstr "" + +msgid "The function :doc:`pgr_extractVertices` is used to create a vertices table based on the edge identifier and the geometry of the edge of the graph." +msgstr "" + +msgid "Finally using the data stored on the vertices tables the ``source`` and ``target`` are filled up." +msgstr "" + +msgid "Migration of ``pgr_createVerticesTable``" +msgstr "" + msgid "**After Deprecation:** The user is responsible to create the vertices table, indexes, etc. They may use :doc:`pgr_extractVertices` for that purpose." msgstr "" @@ -4897,33 +4930,6 @@ msgstr "" msgid "Please consult the `PostgreSQL `__ documentation and the `PostGIS `__ documentation." msgstr "" -msgid "Build a routing topology" -msgstr "" - -msgid "The basic information to use the majority of the pgRouting functions ``id, source, target, cost, [reverse_cost]`` is what in pgRouting is called the routing topology." -msgstr "" - -msgid "``reverse_cost`` is optional but strongly recommended to have in order to reduce the size of the database due to the size of the geometry columns. Having said that, in this documentation ``reverse_cost`` is used in this documentation." -msgstr "" - -msgid "When the data comes with geometries and there is no routing topology, then this step is needed." -msgstr "" - -msgid "All the start and end vertices of the geometries need an identifier that is to be stored in a ``source`` and ``target`` columns of the table of the data. Likewise, ``cost`` and ``reverse_cost`` need to have the value of traversing the edge in both directions." -msgstr "" - -msgid "If the columns do not exist they need to be added to the table in question. (see `ALTER TABLE `__)" -msgstr "" - -msgid "The function :doc:`pgr_extractVertices` is used to create a vertices table based on the edge identifier and the geometry of the edge of the graph." -msgstr "" - -msgid "Finally using the data stored on the vertices tables the ``source`` and ``target`` are filled up." -msgstr "" - -msgid "See :doc:`sampledata` for an example for building a topology." -msgstr "" - msgid "Data coming from OSM and using `osm2pgrouting `__ as an import tool, comes with the routing topology. See an example of using ``osm2pgrouting`` on the `workshop `__." msgstr "" @@ -6919,9 +6925,6 @@ msgstr "" msgid "The edge table to be analyzed must contain a source column and a target column filled with id's of the vertices of the segments and the corresponding vertices table _vertices_pgr that stores the vertices information." msgstr "" -msgid "Use :doc:`pgr_createTopology` to create the topology and the vertices table." -msgstr "" - msgid "The analyze graph function accepts the following parameters:" msgstr "" @@ -6994,9 +6997,6 @@ msgstr "" msgid "The Vertices Table" msgstr "" -msgid "The vertices table can be created with :doc:`pgr_createTopology `" -msgstr "" - msgid "The structure of the vertices table is:" msgstr "" @@ -7168,9 +7168,6 @@ msgstr "" msgid "``boolean`` flag to treat oneway NULL values as bi-directional. Default value is ``true``." msgstr "" -msgid "It is strongly recommended to use the named notation. See :doc:`pgr_createTopology` for examples." -msgstr "" - msgid "Fills completely the ``ein`` and ``eout`` columns of the vertices table." msgstr "" @@ -7180,9 +7177,6 @@ msgstr "" msgid "The rules are defined as an array of text strings that if match the ``oneway`` value would be counted as ``true`` for the source or target **in** or **out** condition." msgstr "" -msgid "The vertices table can be created with :doc:`pgr_createTopology`" -msgstr "" - msgid "``pgr_articulationPoints``" msgstr "" @@ -8290,9 +8284,6 @@ msgstr "" msgid "Node :math:`3` is a dead end node after node :math:`1` is contracted." msgstr "" -msgid "``forbidden_vertices``" -msgstr "" - msgid "``ARRAY[`` |ANY-INTEGER| ``]``" msgstr "" @@ -8551,7 +8542,7 @@ msgstr "" msgid "Create the contracted graph." msgstr "" -msgid "``pgr_createTopology``" +msgid "``pgr_createTopology`` - Deprecated since v3.8.0" msgstr "" msgid "``pgr_createTopology`` — Builds a network topology based on the geometry information." @@ -8803,9 +8794,6 @@ msgstr "" msgid ":doc:`topology-functions` for an overview of a topology for routing algorithms." msgstr "" -msgid ":doc:`pgr_createTopology` ` to create a topology based on the geometry." -msgstr "" - msgid "``pgr_cuthillMckeeOrdering`` - Experimental" msgstr "" @@ -11200,9 +11188,6 @@ msgstr "" msgid "When the maximum flow is **0** then there is no flow and **0** is returned." msgstr "" -msgid "There is no flow when source has the same vaule as target." -msgstr "" - msgid "Uses the :doc:`pgr_pushRelabel ` algorithm." msgstr "" @@ -11383,10 +11368,10 @@ msgstr "" msgid "``integer`` Segment number of the original edge" msgstr "" -msgid "``integer`` Empty source column to be used with :doc:`pgr_createTopology` function" +msgid "``integer`` Empty source column" msgstr "" -msgid "``integer`` Empty target column to be used with :doc:`pgr_createTopology` function" +msgid "``integer`` Empty target column" msgstr "" msgid "the geom" @@ -11449,9 +11434,6 @@ msgstr "" msgid "Inspecting the generated table, we can see that edge 14 has been segmented." msgstr "" -msgid ":doc:`topology-functions` for an overview of a topology for routing algorithms. :doc:`pgr_createTopology` to create a topology based on the geometry." -msgstr "" - msgid "``pgr_pickDeliver`` - Experimental" msgstr "" diff --git a/pgtap/ksp/ksp/edge_cases/issue_285.pg b/pgtap/ksp/ksp/edge_cases/issue_285.pg index 15d757660d5..bb6c5f09f45 100644 --- a/pgtap/ksp/ksp/edge_cases/issue_285.pg +++ b/pgtap/ksp/ksp/edge_cases/issue_285.pg @@ -32,18 +32,30 @@ CREATE TABLE parallel ( y1 double precision, x2 double precision, y2 double precision, - the_geom geometry + geom geometry ); INSERT INTO parallel (x1,y1,x2,y2) VALUES (1,0,1,1),(1,1,1,3),(1,1,1,3),(1,1,1,3),(1,3,1,4); -UPDATE parallel SET the_geom = ST_makeline(ST_point(x1,y1),ST_point(x2,y2)); -UPDATE parallel SET the_geom = ST_makeline(ARRAY[ST_point(1,1),ST_point(0,2),ST_point(1,3)]) WHERE id = 3; -UPDATE parallel SET the_geom = ST_makeline(ARRAY[ST_point(1,1),ST_point(2,1),ST_point(2,3),ST_point(1,3)]) WHERE id = 4; -UPDATE parallel SET cost = ST_length(the_geom), reverse_cost = ST_length(the_geom); +UPDATE parallel SET geom = ST_makeline(ST_point(x1,y1),ST_point(x2,y2)); +UPDATE parallel SET geom = ST_makeline(ARRAY[ST_point(1,1),ST_point(0,2),ST_point(1,3)]) WHERE id = 3; +UPDATE parallel SET geom = ST_makeline(ARRAY[ST_point(1,1),ST_point(2,1),ST_point(2,3),ST_point(1,3)]) WHERE id = 4; +UPDATE parallel SET cost = ST_length(geom), reverse_cost = ST_length(geom); SET client_min_messages=WARNING; -SELECT pgr_createTopology('parallel',0.001); + +SELECT * INTO pvertices +FROM pgr_extractVertices('SELECT id, geom FROM parallel ORDER BY id'); +/* -- set the source information */ +UPDATE parallel AS e +SET source = v.id, x1 = x, y1 = y +FROM pvertices AS v +WHERE ST_StartPoint(e.geom) = v.geom; +/* -- set the target information */ +UPDATE parallel AS e +SET target = v.id, x2 = x, y2 = y +FROM pvertices AS v +WHERE ST_EndPoint(e.geom) = v.geom; SET client_min_messages=NOTICE; SELECT PLAN(7); @@ -52,28 +64,28 @@ PREPARE q1 AS SELECT * FROM pgr_ksp( 'SELECT id, source, target, cost, reverse_cost FROM parallel', - 2, 3, 1, directed:=true + 6, 10, 1, directed:=true ); PREPARE q2 AS SELECT * FROM pgr_ksp( 'SELECT id, source, target, cost, reverse_cost FROM parallel', - 2, 3, 2, directed:=true + 6, 10, 2, directed:=true ); PREPARE q3 AS SELECT * FROM pgr_ksp( 'SELECT id, source, target, cost, reverse_cost FROM parallel', - 2, 3, 3, directed:=true + 6, 10, 3, directed:=true ); PREPARE q4 AS SELECT * FROM pgr_ksp( 'SELECT id, source, target, cost, reverse_cost FROM parallel', - 2, 3, 4, directed:=true + 6, 10, 4, directed:=true ); @@ -81,7 +93,7 @@ PREPARE q5 AS SELECT * FROM pgr_ksp( 'SELECT id, source, target, cost, reverse_cost FROM parallel', - 2, 3, 100, directed:=true + 6, 10, 100, directed:=true ); SELECT set_eq('q1', 'q2'); @@ -93,28 +105,28 @@ PREPARE q6 AS SELECT * FROM pgr_ksp( 'SELECT id, source, target, cost, reverse_cost FROM parallel', - 1, 4, 1, directed:=true + 5, 15, 1, directed:=true ); PREPARE q7 AS SELECT * FROM pgr_ksp( 'SELECT id, source, target, cost, reverse_cost FROM parallel', - 1, 4, 2, directed:=true + 5, 15, 2, directed:=true ); PREPARE q8 AS SELECT * FROM pgr_ksp( 'SELECT id, source, target, cost, reverse_cost FROM parallel', - 1, 4, 3, directed:=true + 5, 15, 3, directed:=true ); PREPARE q9 AS SELECT * FROM pgr_ksp( 'SELECT id, source, target, cost, reverse_cost FROM parallel', - 1, 4, 100, directed:=true + 5, 15, 100, directed:=true ); SELECT set_eq('q6', 'q7'); diff --git a/pgtap/topology/analyzeGraph/edge_cases.pg b/pgtap/topology/analyzeGraph/edge_cases.pg index 5ad6ce9a8dc..7ca6faa453d 100644 --- a/pgtap/topology/analyzeGraph/edge_cases.pg +++ b/pgtap/topology/analyzeGraph/edge_cases.pg @@ -24,12 +24,27 @@ UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); SELECT plan(3); -SELECT pgr_createTopology('edges',0.001, 'geom', clean := true); +SELECT id, geom AS the_geom, + NULL::INTEGER AS cnt, NULL::INTEGER AS chk, + NULL::INTEGER AS ein, NULL::INTEGER AS eout +INTO edges_vertices_pgr +FROM pgr_extractVertices('SELECT id, geom FROM edges ORDER BY id'); +/* -- set the source information */ +UPDATE edges AS e +SET source = v.id +FROM edges_vertices_pgr AS v +WHERE ST_StartPoint(e.geom) = v.the_geom; +/* -- set the target information */ +UPDATE edges AS e +SET target = v.id +FROM edges_vertices_pgr AS v +WHERE ST_EndPoint(e.geom) = v.the_geom; + SELECT pgr_analyzegraph('edges', 0.000001, 'geom'); SELECT is((SELECT count(*)::INTEGER cnt FROM edges_vertices_pgr WHERE chk = 1), 1, '1: One vertex has a problem'); -SELECT is((SELECT id::INTEGER FROM edges_vertices_pgr WHERE chk = 1), 10, '2: vertex #15 has the problem'); +SELECT is((SELECT id::INTEGER FROM edges_vertices_pgr WHERE chk = 1), 4, '2: vertex #15 has the problem'); PREPARE q1 AS SELECT cnt, count(*) AS M FROM edges_vertices_pgr GROUP BY cnt ORDER BY cnt; diff --git a/pgtap/topology/createVerticesTable/edge_cases.pg b/pgtap/topology/createVerticesTable/edge_cases.pg index 4f7c8ccdef6..4551fa0c66e 100644 --- a/pgtap/topology/createVerticesTable/edge_cases.pg +++ b/pgtap/topology/createVerticesTable/edge_cases.pg @@ -31,7 +31,22 @@ UPDATE edges2 SET source = NULL, target = NULL; -- The following should be OK -SELECT pgr_createTopology('edges2',0.00001, id:='id', clean := true); +SELECT *, + NULL::INTEGER AS cnt, NULL::INTEGER AS chk, + NULL::INTEGER AS ein, NULL::INTEGER AS eout +INTO edges2_vertices_pgr +FROM pgr_extractVertices('SELECT id, the_geom AS geom FROM edges2 ORDER BY id'); +/* -- set the source information */ +UPDATE edges2 AS e +SET source = v.id +FROM edges2_vertices_pgr AS v +WHERE ST_StartPoint(e.the_geom) = v.geom; +/* -- set the target information */ +UPDATE edges2 AS e +SET target = v.id +FROM edges2_vertices_pgr AS v +WHERE ST_EndPoint(e.the_geom) = v.geom; + PREPARE q1 AS SELECT count(*) FROM public.edges2_vertices_pgr; SELECT results_eq('q1', ARRAY[17]::BIGINT[]); diff --git a/pgtap/topology/nodeNetwork/edge_cases.pg b/pgtap/topology/nodeNetwork/edge_cases.pg index 0654eea8af9..90c0139fed0 100644 --- a/pgtap/topology/nodeNetwork/edge_cases.pg +++ b/pgtap/topology/nodeNetwork/edge_cases.pg @@ -55,7 +55,25 @@ SELECT set_eq('q1', 'vals1', SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE source is NULL), 40, '40 edges are missing source'); SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE target is NULL), 40, '40 edges are missing target'); SELECT hasnt_table('original_noded_vertices_pgr', 'original_noded_vertices_pgr table does not exist'); -SELECT pgr_createtopology('original_noded', 0.000001); + +SELECT *, + NULL::INTEGER AS cnt, NULL::INTEGER AS chk, + NULL::INTEGER AS ein, NULL::INTEGER AS eout +INTO original_noded_vertices_pgr +FROM pgr_extractVertices('SELECT id, the_geom AS geom FROM original_noded ORDER BY id'); + +-- set the source information +UPDATE original_noded AS e +SET source = v.id +FROM original_noded_vertices_pgr AS v +WHERE ST_StartPoint(e.the_geom) = v.geom; + +-- set the target information +UPDATE original_noded AS e +SET target = v.id +FROM original_noded_vertices_pgr AS v +WHERE ST_EndPoint(e.the_geom) = v.geom; + SELECT has_table('original_noded_vertices_pgr', 'original_noded_vertices_pgr table now exist'); SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE source is NULL), 0, '0 edges are missing source'); SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE target is NULL), 0, '0 edges are missing target'); @@ -98,7 +116,25 @@ SELECT is( SELECT is((SELECT count(*)::INTEGER FROM noded WHERE source is NULL), 40, '40 edges are missing source'); SELECT is((SELECT count(*)::INTEGER FROM noded WHERE target is NULL), 40, '40 edges are missing target'); SELECT hasnt_table('noded_vertices_pgr', 'noded_vertices_pgr table does not exist'); -SELECT pgr_createtopology('noded', 0.000001,id:='gid'); + +SELECT *, + NULL::INTEGER AS cnt, NULL::INTEGER AS chk, + NULL::INTEGER AS ein, NULL::INTEGER AS eout +INTO noded_vertices_pgr +FROM pgr_extractVertices('SELECT id, the_geom AS geom FROM noded ORDER BY id'); + +-- set the source information +UPDATE noded AS e +SET source = v.id +FROM noded_vertices_pgr AS v +WHERE ST_StartPoint(e.the_geom) = v.geom; + +-- set the target information +UPDATE noded AS e +SET target = v.id +FROM noded_vertices_pgr AS v +WHERE ST_EndPoint(e.the_geom) = v.geom; + SELECT has_table('noded_vertices_pgr', 'noded_vertices_pgr table now exist'); SELECT is((SELECT count(*)::INTEGER FROM noded WHERE source is NULL), 0, '0 edges are missing source'); SELECT is((SELECT count(*)::INTEGER FROM noded WHERE target is NULL), 0, '0 edges are missing target'); diff --git a/pgtap/topology/nodeNetwork/issue_1009.pg b/pgtap/topology/nodeNetwork/issue_1009.pg index 56bb0b883fb..6662e615889 100644 --- a/pgtap/topology/nodeNetwork/issue_1009.pg +++ b/pgtap/topology/nodeNetwork/issue_1009.pg @@ -53,7 +53,23 @@ SELECT set_eq('q1', 'vals1', SELECT is((SELECT count(*)::INTEGER FROM test_graph_noded WHERE source is NULL), (SELECT count(*)::INTEGER FROM test_graph_noded), 'all edges are missing source'); SELECT is((SELECT count(*)::INTEGER FROM test_graph_noded WHERE target is NULL), (SELECT count(*)::INTEGER FROM test_graph_noded), 'all edges are missing target'); SELECT hasnt_table('test_graph_noded_vertices_pgr', 'test_graph_noded_vertices_pgr table does not exist'); -SELECT pgr_createtopology('test_graph_noded', 0.000001, 'geom', 'id'); + +SELECT *, + NULL::INTEGER AS cnt, NULL::INTEGER AS chk, + NULL::INTEGER AS ein, NULL::INTEGER AS eout +INTO test_graph_noded_vertices_pgr +FROM pgr_extractVertices('SELECT id, geom FROM test_graph_noded ORDER BY id'); +/* -- set the source information */ +UPDATE test_graph_noded AS e +SET source = v.id +FROM test_graph_noded_vertices_pgr AS v +WHERE ST_StartPoint(e.geom) = v.geom; +/* -- set the target information */ +UPDATE test_graph_noded AS e +SET target = v.id +FROM test_graph_noded_vertices_pgr AS v +WHERE ST_EndPoint(e.geom) = v.geom; + SELECT has_table('test_graph_noded_vertices_pgr', 'test_graph_noded_vertices_pgr table now exist'); SELECT is((SELECT count(*)::INTEGER FROM test_graph_noded WHERE source is NULL), 0, '0 edges are missing source'); SELECT is((SELECT count(*)::INTEGER FROM test_graph_noded WHERE target is NULL), 0, '0 edges are missing target'); diff --git a/pgtap/topology/nodeNetwork/issue_1074.pg b/pgtap/topology/nodeNetwork/issue_1074.pg index d56100334b9..5e667c0bc5e 100644 --- a/pgtap/topology/nodeNetwork/issue_1074.pg +++ b/pgtap/topology/nodeNetwork/issue_1074.pg @@ -74,7 +74,23 @@ SELECT set_eq('q1', 'vals1', SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE source is NULL), (SELECT count(*)::INTEGER FROM original_noded), 'all edges are missing source'); SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE target is NULL), (SELECT count(*)::INTEGER FROM original_noded), 'all edges are missing target'); SELECT hasnt_table('original_noded_vertices_pgr', 'original_noded_vertices_pgr table does not exist'); -SELECT pgr_createtopology('original_noded', 0.000001); + +SELECT *, + NULL::INTEGER AS cnt, NULL::INTEGER AS chk, + NULL::INTEGER AS ein, NULL::INTEGER AS eout +INTO original_noded_vertices_pgr +FROM pgr_extractVertices('SELECT id, the_geom AS geom FROM original_noded ORDER BY id'); +/* -- set the source information */ +UPDATE original_noded AS e +SET source = v.id +FROM original_noded_vertices_pgr AS v +WHERE ST_StartPoint(e.the_geom) = v.geom; +/* -- set the target information */ +UPDATE original_noded AS e +SET target = v.id +FROM original_noded_vertices_pgr AS v +WHERE ST_EndPoint(e.the_geom) = v.geom; + SELECT has_table('original_noded_vertices_pgr', 'original_noded_vertices_pgr table now exist'); SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE source is NULL), 0, '0 edges are missing source'); SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE target is NULL), 0, '0 edges are missing target'); diff --git a/pgtap/topology/nodeNetwork/issue_1336.pg b/pgtap/topology/nodeNetwork/issue_1336.pg index f1b19316f75..f7fa8d9abf7 100644 --- a/pgtap/topology/nodeNetwork/issue_1336.pg +++ b/pgtap/topology/nodeNetwork/issue_1336.pg @@ -58,7 +58,23 @@ SELECT set_eq('q1_hard', 'vals1_hard', SELECT is((SELECT count(*)::INTEGER FROM original_hard_noded WHERE source is NULL), (SELECT count(*)::INTEGER FROM original_hard_noded), 'all edges are missing source'); SELECT is((SELECT count(*)::INTEGER FROM original_hard_noded WHERE target is NULL), (SELECT count(*)::INTEGER FROM original_hard_noded), 'all edges are missing target'); SELECT hasnt_table('original_hard_noded_vertices_pgr', 'original_hard_noded_vertices_pgr table does not exist'); -SELECT pgr_createtopology('original_hard_noded', 0.000001); + +SELECT *, + NULL::INTEGER AS cnt, NULL::INTEGER AS chk, + NULL::INTEGER AS ein, NULL::INTEGER AS eout +INTO original_hard_noded_vertices_pgr +FROM pgr_extractVertices('SELECT id, the_geom AS geom FROM original_hard_noded ORDER BY id'); +/* -- set the source information */ +UPDATE original_hard_noded AS e +SET source = v.id +FROM original_hard_noded_vertices_pgr AS v +WHERE ST_StartPoint(e.the_geom) = v.geom; +/* -- set the target information */ +UPDATE original_hard_noded AS e +SET target = v.id +FROM original_hard_noded_vertices_pgr AS v +WHERE ST_EndPoint(e.the_geom) = v.geom; + SELECT has_table('original_hard_noded_vertices_pgr', 'original_hard_noded_vertices_pgr table now exist'); SELECT is((SELECT count(*)::INTEGER FROM original_hard_noded WHERE source is NULL), 0, '0 edges are missing source'); SELECT is((SELECT count(*)::INTEGER FROM original_hard_noded WHERE target is NULL), 0, '0 edges are missing target'); diff --git a/sql/topology/createtopology.sql b/sql/topology/createtopology.sql index c6ddc0d8605..df29077d6f1 100644 --- a/sql/topology/createtopology.sql +++ b/sql/topology/createtopology.sql @@ -105,6 +105,7 @@ DECLARE BEGIN msgKind = 1; -- notice + RAISE WARNING 'pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0'; fnName = 'pgr_createTopology'; RAISE notice 'PROCESSING:'; RAISE notice 'pgr_createTopology(''%'', %, ''%'', ''%'', ''%'', ''%'', rows_where := ''%'', clean := %)',edge_table,tolerance,the_geom,id,source,target,rows_where, clean; @@ -307,17 +308,4 @@ LANGUAGE plpgsql VOLATILE STRICT; COMMENT ON FUNCTION pgr_createTopology(TEXT, FLOAT, TEXT, TEXT, TEXT, TEXT, TEXT, BOOLEAN) -IS 'pgr_createTopology - - Parameters - - Edge table name - - tolerance - - Optional parameters - - the_geom := ''the_geom'' - - id := ''id'' - - source := ''source'' - - target := ''target'' - - rows_where := ''true'' - - clean := false -- Documentation: - - ${PROJECT_DOC_LINK}/pgr_createTopology.html -'; +IS 'pgr_createTopology deprecated function on v3.8.0';