-
-
Notifications
You must be signed in to change notification settings - Fork 376
Deprecate pgr create topology #2830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate pgr create topology #2830
Conversation
- Removing use on doc, pgtap and docqueries - (doc) documenting changes on release notes & NEWS
WalkthroughThis pull request updates multiple documentation and SQL files to reflect changes around the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User/Client
participant DB as Database Engine
participant V as Vertices Table
participant E as Edges Table
U->>DB: Execute topology creation query
DB->>V: Drop existing vertices table (if exists)
DB->>V: Create new vertices table via vertex extraction
DB->>E: Update edges table with source and target based on vertices
DB-->>U: Return updated topology data and warnings for deprecated functions
Assessment against linked issues
Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
♻️ Duplicate comments (5)
docqueries/lineGraph/proofOfConcept1.result (5)
73-129
: Repeated negative ID usage: duplicate comment.
Same observation about negative IDs and large ID multiplications applies here. Confirm consistency with the rest of the dataset and ensure no unintended collisions occur.
344-381
: Re-confirm negative ID usage in path queries: duplicate comment.
As with the earlier lines, this block uses negative ID values extensively. Cross-check they map correctly to the underlying edges and vertices.
552-576
: Duplicate comment on negative IDs in queries.
Same usage pattern for negative IDs instart_vid
andend_vid
. Please ensure it matches the intended graph logic.
580-596
: No new issues identified—duplicate comment on IDs.
Again, verify the correctness of negative ID usage and confirm the transformations align with your graph structure.
599-607
: Duplicate comment: Confirm final path queries with negative IDs.
The result set again references negative source/target IDs. Ensure a consistent interpretation throughout your environment.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (33)
NEWS.md
(1 hunks)doc/_static/page_history.js
(1 hunks)doc/contraction/pgr_contractionDeadEnd.rst
(1 hunks)doc/max_flow/pgr_maxFlow.rst
(1 hunks)doc/max_flow/pgr_maxFlowMinCost_Cost.rst
(1 hunks)doc/src/migration.rst
(1 hunks)doc/src/pgRouting-concepts.rst
(2 hunks)doc/src/release_notes.rst
(1 hunks)doc/topology/pgr_analyzeGraph.rst
(0 hunks)doc/topology/pgr_analyzeOneWay.rst
(0 hunks)doc/topology/pgr_createTopology.rst
(1 hunks)doc/topology/pgr_createVerticesTable.rst
(0 hunks)doc/topology/pgr_nodeNetwork.rst
(1 hunks)docqueries/lineGraph/proofOfConcept1.pg
(3 hunks)docqueries/lineGraph/proofOfConcept1.result
(7 hunks)docqueries/src/concepts.pg
(1 hunks)docqueries/src/concepts.result
(1 hunks)docqueries/topology/analyzeGraph.pg
(4 hunks)docqueries/topology/analyzeGraph.result
(4 hunks)docqueries/topology/analyzeOneWay.pg
(1 hunks)docqueries/topology/analyzeOneWay.result
(1 hunks)docqueries/topology/createTopology.result
(17 hunks)docqueries/topology/issue900.result
(1 hunks)locale/en/LC_MESSAGES/pgrouting_doc_strings.po
(6 hunks)locale/pot/pgrouting_doc_strings.pot
(6 hunks)pgtap/ksp/ksp/edge_cases/issue_285.pg
(3 hunks)pgtap/topology/analyzeGraph/edge_cases.pg
(1 hunks)pgtap/topology/createVerticesTable/edge_cases.pg
(1 hunks)pgtap/topology/nodeNetwork/edge_cases.pg
(2 hunks)pgtap/topology/nodeNetwork/issue_1009.pg
(1 hunks)pgtap/topology/nodeNetwork/issue_1074.pg
(1 hunks)pgtap/topology/nodeNetwork/issue_1336.pg
(1 hunks)sql/topology/createtopology.sql
(2 hunks)
💤 Files with no reviewable changes (3)
- doc/topology/pgr_createVerticesTable.rst
- doc/topology/pgr_analyzeOneWay.rst
- doc/topology/pgr_analyzeGraph.rst
👮 Files not reviewed due to content moderation or server errors (1)
- locale/pot/pgrouting_doc_strings.pot
⏰ Context from checks skipped due to timeout of 90000ms (16)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Ubuntu Boost (86)
- GitHub Check: Ubuntu Boost (77)
- GitHub Check: Ubuntu Boost (80)
- GitHub Check: Ubuntu Boost (79)
- GitHub Check: Ubuntu Boost (84)
- GitHub Check: Ubuntu Boost (75)
- GitHub Check: Ubuntu Boost (83)
- GitHub Check: Ubuntu Boost (56)
- GitHub Check: Ubuntu Boost (78)
- GitHub Check: Ubuntu Boost (76)
- GitHub Check: Ubuntu Boost (68)
- GitHub Check: macos (macos-latest)
- GitHub Check: macos (macos-14)
- GitHub Check: Ubuntu clang
- GitHub Check: Check queries
🔇 Additional comments (56)
docqueries/topology/analyzeOneWay.result (1)
8-8
: Good replacement for the deprecated function.Replacing the
pgr_createTopology
usage with a direct creation ofedges_vertices_pgr
fromvertices
aligns with the deprecation goals and looks straightforward.doc/topology/pgr_nodeNetwork.rst (1)
81-82
: Documentation updates match deprecation stance.Removing references to the deprecated
pgr_createTopology
function and clarifying the columns as empty is appropriate and consistent with the new approach.docqueries/topology/analyzeGraph.result (4)
6-7
: Consistency with manual table creation.Creating
edges_vertices_pgr
directly fromvertices
without the deprecated function is correct and appears to pose no issues.
202-203
: Synchronous pattern for alternate table creation.Similarly creating
mytable_vertices_pgr
fromvertices
follows the new manual approach. No concerns identified.
435-436
: Resetting counts and checks.The update on
edges_vertices_pgr
ensures counters are cleared prior to analysis. No problems noted.
529-532
: Clean up and reset.Removing unwanted edges and resetting vertex counters is consistent with manual maintenance of topology data. Implementation appears sound.
pgtap/ksp/ksp/edge_cases/issue_285.pg (4)
35-35
: Renamed geometry column to follow standard naming conventions.The column name has been updated from
the_geom
togeom
, which aligns with modern GIS naming conventions.
41-44
: Updated geometry column references in UPDATE statements.All references to
the_geom
have been replaced withgeom
to match the column name change in the table definition.
47-58
: Replaced pgr_createTopology with direct vertex extraction.This change implements the manual creation of topology by:
- Extracting vertices using
pgr_extractVertices
- Updating source and target fields based on start/end points
This aligns with the deprecation of
pgr_createTopology
as specified in the PR objectives.
67-67
:❓ Verification inconclusive
Modified source and target node parameters in pgr_ksp function calls.
The source and target parameters have been changed from
(2, 3, ...)
to(6, 10, ...)
or(5, 15, ...)
, which might affect test results.Also applies to: 74-74, 81-81, 88-88, 96-96, 108-108, 115-115, 122-122, 129-129
🏁 Script executed:
#!/bin/bash # Verify if these node IDs align with the new vertex extraction method echo "Checking vertex IDs in parallel table:" psql -c "SELECT id, geom FROM pvertices WHERE id IN (5, 6, 10, 15) ORDER BY id" 2>/dev/null || echo "Cannot verify directly in the test environment"Length of output: 271
Updated pgr_ksp Parameter Changes Require Manual Verification
- The new node IDs (6, 10 and 5, 15) in pgr_ksp calls were updated from the previous (2, 3, …) values.
- The verification script output (“Cannot verify directly in the test environment”) indicates that we couldn’t confirm the vertex IDs through automated means.
- Please manually verify that these updated IDs correctly match the intended vertices according to the new vertex extraction method.
pgtap/topology/nodeNetwork/issue_1336.pg (1)
62-76
: Replaced pgr_createTopology with manual vertex extraction and field updates.This implementation:
- Creates a vertices table using
pgr_extractVertices
- Adds NULL columns for topology analysis (cnt, chk, ein, eout)
- Updates source and target fields by matching start/end points with vertex geometries
This is a robust replacement for the deprecated
pgr_createTopology
function and follows the same pattern used in other test files.sql/topology/createtopology.sql (2)
108-108
: Added deprecation warning message.The warning clearly indicates that
pgr_createTopology
is deprecated as of version 3.8.0, providing users with important information about the function's status.
311-311
: Simplified function comment to indicate deprecation.The function comment has been streamlined to only state that the function is deprecated in v3.8.0, removing detailed parameter descriptions that are no longer relevant for a deprecated function.
pgtap/topology/nodeNetwork/edge_cases.pg (2)
59-76
: Implemented vertex extraction for original_noded table.This code replaces
pgr_createTopology
with direct vertex extraction and field updates:
- Creates a vertices table with required topology columns
- Updates source field by matching start points
- Updates target field by matching end points
The implementation is consistent with other files and properly manages the transition away from the deprecated function.
120-137
: Implemented vertex extraction for noded table.Similar to the changes for original_noded, this code:
- Creates a vertices table with required topology columns
- Updates source field by matching start points
- Updates target field by matching end points
This implementation maintains consistency across the codebase in how topology is handled.
doc/max_flow/pgr_maxFlowMinCost_Cost.rst (1)
49-49
: Spelling correction improves documentation quality.The word "value" is now correctly spelled in the documentation, enhancing readability and professionalism.
doc/max_flow/pgr_maxFlow.rst (1)
48-48
: Spelling correction maintains consistency across documentation.The word "value" is now correctly spelled, matching the same correction made in the
pgr_maxFlowMinCost_Cost
documentation. This ensures terminology consistency throughout the documentation.docqueries/topology/issue900.result (1)
11-11
: Appropriate deprecation warning implemented for pgr_createTopology.The warning message clearly indicates that the function is deprecated as of version 3.8.0, which aligns with the PR objective to deprecate this function. This helps users prepare for future changes while maintaining functionality during the transition period.
locale/en/LC_MESSAGES/pgrouting_doc_strings.po (4)
11-11
: No issues found.
3972-3975
: References to #2750 look correct.
No concerns with linking issue #2750 topgr_createTopology
.
4060-4060
: Deprecation heading is consistent.
The new doc string heading aligns well with the deprecation objectives.
9952-9952
: Deprecation note is valid.
The marking "pgr_createTopology
- Deprecated since v3.8.0" is accurate and matches the planned deprecation timeline.doc/contraction/pgr_contractionDeadEnd.rst (1)
142-142
: Parameter name standardization is good!The change from
forbidden_vertices
toforbidden
makes the parameter name more concise while maintaining clarity. This standardization is helpful for API consistency.doc/src/release_notes.rst (1)
74-76
: Correctly documented the deprecation.The addition of
pgr_createTopology
to the list of deprecated functions in the release notes is appropriate and includes a proper reference to the related issue #2750. This documentation helps users understand the API changes in version 3.8.0.docqueries/topology/analyzeOneWay.pg (1)
5-5
: Replacement for deprecated pgr_createTopology function.This change replaces the deprecated
pgr_createTopology
function with direct SQL that creates the vertices table manually. The new approach selects from thevertices
table and adds the requiredein
andeout
columns that are needed for the one-way analysis.pgtap/topology/createVerticesTable/edge_cases.pg (1)
34-48
: Good replacement for topology creation.This code replaces the deprecated
pgr_createTopology
with a more explicit approach that:
- Uses
pgr_extractVertices
to identify vertices from edge geometries- Creates a vertices table with necessary columns for connectivity analysis
- Updates the source and target fields in the edge table based on geometric endpoints
This implementation maintains the same functionality while removing dependency on the deprecated function.
docqueries/src/concepts.pg (1)
259-275
: Well-structured replacement for pgr_createTopology functionalityThis new section provides a clear example of how to create a topology without using the deprecated
pgr_createTopology
function. The approach usespgr_extractVertices
to create a vertices table and then updates the edges table to set source and target fields based on the geometric start and end points.The implementation is organized logically with:
- First extracting vertices from edges
- Then setting source information
- Finally setting target information
This provides users with a good migration path from the deprecated function.
doc/src/migration.rst (1)
27-44
: Clear migration documentation for pgr_createTopologyThe new migration section provides essential information for users to understand:
- When the function was deprecated (v3.8.0)
- What the function did before deprecation
- What users need to do after deprecation
- A reference to additional documentation with the new approach
This addition aligns well with the PR objective to properly document the deprecation process and provide users with migration guidance.
docqueries/topology/createTopology.result (1)
9-9
: Consistent deprecation warnings added to all function callsThe deprecation warnings have been correctly added to all instances of
pgr_createTopology
function calls. This ensures users are informed about the deprecation status across all example usages.The warnings consistently state: "pgr_createtopology(text,double precision,text,text,text,text,text,boolean) deprecated function on v3.8.0"
Also applies to: 29-29, 49-49, 71-71, 85-85, 98-98, 107-107, 117-117, 129-129, 142-142, 157-157, 174-174, 187-187, 196-196, 203-203, 211-211, 219-219, 229-229, 237-237, 248-248, 263-263
pgtap/topology/analyzeGraph/edge_cases.pg (2)
27-41
: Replaced pgr_createTopology with direct topology creation in testsThe test has been updated to create the topology directly using:
pgr_extractVertices
to populate the vertices table- SQL updates to set the source and target fields based on geometry endpoints
This implementation correctly reflects the recommended approach now that
pgr_createTopology
is deprecated.
47-47
: Updated test assertion to match new expected valueThe test assertion has been updated to expect vertex ID 4 as the problematic vertex rather than the previous value. This change is necessary because the topology creation method has changed, resulting in different vertex IDs.
pgtap/topology/nodeNetwork/issue_1009.pg (1)
56-71
: Good refactoring to replace pgr_createTopology with direct topology creation.The changes successfully implement the manual topology creation process to replace the deprecated
pgr_createTopology
function. The implementation correctly:
- Creates vertices table using
pgr_extractVertices
- Updates the source/target fields based on geometry endpoints
- Maintains the same functionality as the original code
This approach aligns with the PR objective of deprecating
pgr_createTopology
.docqueries/src/concepts.result (1)
451-469
: Well implemented topology creation replacement.The changes successfully demonstrate the new recommended approach for manually creating topology instead of using the deprecated
pgr_createTopology
function. The implementation follows a clear pattern:
- Drop existing vertices table
- Create new vertices table using
pgr_extractVertices
- Update edge source/target fields based on geometry endpoints
This documentation update is essential for users to understand how to migrate from the deprecated function.
pgtap/topology/nodeNetwork/issue_1074.pg (1)
77-93
: Correctly implemented manual topology creation.The changes successfully replace the deprecated
pgr_createTopology
function with direct SQL operations:
- Extract vertices using
pgr_extractVertices
- Create vertices table with additional columns
- Update source/target fields in edges table
This implementation maintains test integrity while adhering to the deprecation plan.
docqueries/topology/analyzeGraph.pg (4)
10-10
: Good adaptation of the test to work without pgr_createTopology.The code now directly initializes the
edges_vertices_pgr
table from an existing vertices table, which is a valid alternative to using the deprecated function in this context.
49-49
: Consistent implementation for the second test table.Similar to the first instance, this creates the vertices table directly from the existing vertices. This maintains consistency in the approach throughout the file.
99-99
: Appropriate update to reset vertex counters.Instead of recreating the topology with the deprecated function, this correctly resets the counter values directly, which maintains the same test functionality.
117-118
: Well structured cleanup and reset.The code now explicitly:
- Deletes edges with ID >= 17
- Resets counters in the vertices table
This maintains the same functionality while avoiding the deprecated function call.
doc/_static/page_history.js (1)
223-223
: Version mapping update forpgr_createTopology
is correct.The version mapping for
pgr_createTopology
has been updated to include version 3.8, which aligns with the function's deprecation in that version. This ensures proper tracking of the function's documentation history.docqueries/lineGraph/proofOfConcept1.pg (6)
6-7
: Schema change to directly extract source and target from edges.The code now directly extracts the
source
andtarget
fields from theedges
table rather than initializing them as NULL. This approach aligns with the topology changes and reduces unnecessary operations.
10-13
: New vertices table creation approach.This addition properly creates a vertices table directly from the existing vertices data, which is aligned with the movement away from
pgr_createTopology
. This is a good alternative approach for vertex management.
17-17
: Vertex ID scaling for consistency.The update statement scales vertex IDs by 1000, maintaining consistency with the edge update on line 16. This ensures proper topology relationships between edges and vertices.
104-105
: Updated vertex IDs in Dijkstra algorithm call.The vertex IDs used in the query have been updated from 2000/3000 to 6000/10000, which must align with other changes in the test case. This ensures the test remains valid after topology changes.
111-113
: Query filter condition updated.The filter conditions now consistently use the new vertex ID value of 10000, maintaining alignment with the changes made on lines 104-105.
128-128
: Updated target vertex IDs in Dijkstra function call.The final Dijkstra function call now uses the updated vertex IDs (6000/10000), ensuring consistency with the previous query changes.
doc/src/pgRouting-concepts.rst (4)
492-493
: Added clear section markers for topology creation.The addition of
createTopology_start
marker creates a well-defined section for documenting the manual topology creation process, improving documentation organization.
520-523
: Added code examples for creating vertices table.This new code inclusion provides practical examples of how to extract vertices from edge geometry - a critical step in manually creating a topology without relying on the deprecated
pgr_createTopology
function.
527-530
: Added code examples for updating source and target columns.This second code snippet demonstrates how to properly populate the source and target columns in the edge table, completing the manual topology creation process that replaces the deprecated function.
531-532
: Section end marker for topology creation.The closing marker cleanly ends the new section, maintaining proper documentation structure.
doc/topology/pgr_createTopology.rst (4)
11-12
: Updated index entries with deprecation notice.The index entries now clearly indicate that both
pgr_createTopology
andcreateTopology
are deprecated since version 3.8.0, ensuring users find this information when searching the documentation.
16-16
: Updated function title with deprecation notice.The function title now explicitly states that the function is deprecated since v3.8.0, providing immediate visibility of the deprecation status.
24-27
: Added version-specific deprecation information.The availability section now properly documents that the function is deprecated starting from version 3.8.0, providing clear version context for users.
33-36
: Added migration guidance.The inclusion of migration instructions directs users to the proper documentation for transitioning away from the deprecated function, which is essential for maintaining backward compatibility while encouraging adoption of the recommended approach.
docqueries/lineGraph/proofOfConcept1.result (3)
8-8
: Confirm the presence ofgeom
column inedges
.
The SELECT statement still references thegeom
column although other geometry-related references were removed elsewhere. Please verify thatgeom
indeed exists in theedges
table and confirm its usage aligns with the intended deprecation of certain topology features.
34-59
: Verify negative vertex IDs and transformations.
These rows indicate negative IDs in thesource
andtarget
columns. While this might be intentional (e.g., storing special sentinel nodes or offset-based indexing), it can be confusing or error-prone in certain queries. Please confirm if these negative ID values are expected and consistent across the rest of the queries.
339-340
: Good approach for setting array of start/end vertices.
Defining start and end vertices with a subselect that aggregates their IDs is clear and concise.
Fixes #2750 .
Changes proposed in this pull request:
@pgRouting/admins
Summary by CodeRabbit