-
-
Notifications
You must be signed in to change notification settings - Fork 376
new function pgr_separateCrossing 3.8 #2851
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
new function pgr_separateCrossing 3.8 #2851
Conversation
Warning Rate limit exceeded@cvvergara has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 14 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (32)
WalkthroughThis update introduces the new utility function Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant pgr_separateCrossing (SQL Function)
participant PostGIS
participant Database
User->>pgr_separateCrossing: Call with Edges SQL, tolerance, dryrun
pgr_separateCrossing->>Database: Validate input SQL and columns
pgr_separateCrossing->>PostGIS: Find crossing edges and intersection points
pgr_separateCrossing->>PostGIS: Snap geometries (ST_Snap)
pgr_separateCrossing->>PostGIS: Split edges at crossings (ST_Split)
pgr_separateCrossing->>Database: Return (or output) split edges with new sub-IDs
pgr_separateCrossing-->>User: Return result set or generated SQL (if dryrun)
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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: 12
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (30)
NEWS.md
(1 hunks)doc/_static/page_history.js
(1 hunks)doc/conf.py.in
(1 hunks)doc/src/pgRouting-concepts.rst
(1 hunks)doc/src/proposed.rst
(1 hunks)doc/src/release_notes.rst
(1 hunks)doc/src/routingFunctions.rst
(1 hunks)doc/topology/pgr_extractVertices.rst
(2 hunks)doc/topology/topology-functions.rst
(2 hunks)doc/utilities/CMakeLists.txt
(1 hunks)doc/utilities/pgr_separateCrossing.rst
(1 hunks)doc/withPoints/pgr_withPointsCost.rst
(1 hunks)docqueries/src/concepts.pg
(0 hunks)docqueries/src/concepts.result
(6 hunks)docqueries/utilities/CMakeLists.txt
(1 hunks)docqueries/utilities/separateCrossing.pg
(1 hunks)docqueries/utilities/separateCrossing.result
(1 hunks)docqueries/utilities/test.conf
(1 hunks)pgtap/utilities/separateCrossing/edge_cases.pg
(1 hunks)pgtap/utilities/separateCrossing/issue_1009.pg
(1 hunks)pgtap/utilities/separateCrossing/issue_1074.pg
(1 hunks)pgtap/utilities/separateCrossing/issue_1336.pg
(1 hunks)pgtap/utilities/separateCrossing/issue_1882.pg
(1 hunks)pgtap/utilities/separateCrossing/issue_280.pg
(1 hunks)pgtap/utilities/separateCrossing/issue_623.pg
(1 hunks)pgtap/utilities/separateCrossing/types_check.pg
(1 hunks)sql/sigs/pgrouting--3.8.sig
(1 hunks)sql/utilities/CMakeLists.txt
(1 hunks)sql/utilities/separateCrossing.sql
(1 hunks)tools/testers/general_pgtap_tests.sql
(2 hunks)
💤 Files with no reviewable changes (1)
- docqueries/src/concepts.pg
🧰 Additional context used
🧠 Learnings (8)
sql/sigs/pgrouting--3.8.sig (2)
Learnt from: cvvergara
PR: pgRouting/pgrouting#2764
File: sql/sigs/pgrouting--3.8.sig:274-275
Timestamp: 2025-02-27T16:34:57.518Z
Learning: The file `sql/sigs/pgrouting--3.8.sig` is auto-generated by a command and should not be modified manually.
Learnt from: cvvergara
PR: pgRouting/pgrouting#2764
File: sql/sigs/pgrouting--3.8.sig:125-136
Timestamp: 2025-02-27T16:33:56.959Z
Learning: The file sql/sigs/pgrouting--*.sig is automatically generated by a command and cannot be manually modified. Comments about naming conventions or other improvements should be directed at the source code that generates these signatures, not at the signature file itself.
pgtap/utilities/separateCrossing/issue_1336.pg (1)
Learnt from: cvvergara
PR: pgRouting/pgrouting#2725
File: src/coloring/edgeColoring_driver.cpp:87-87
Timestamp: 2025-01-19T16:17:53.496Z
Learning: Changes to error message handling in pgRouting functions require corresponding updates to pgtap tests to maintain test coverage.
pgtap/utilities/separateCrossing/issue_280.pg (1)
Learnt from: cvvergara
PR: pgRouting/pgrouting#2725
File: src/coloring/edgeColoring_driver.cpp:87-87
Timestamp: 2025-01-19T16:17:53.496Z
Learning: Changes to error message handling in pgRouting functions require corresponding updates to pgtap tests to maintain test coverage.
tools/testers/general_pgtap_tests.sql (1)
Learnt from: cvvergara
PR: pgRouting/pgrouting#0
File: :0-0
Timestamp: 2025-01-27T01:49:25.212Z
Learning: pgRouting version checks in tests:
- Use min_version() for SQL API changes
- Use min_lib_version() for C/C++ library changes
- Adjust test plans based on version conditions
pgtap/utilities/separateCrossing/issue_1009.pg (1)
Learnt from: cvvergara
PR: pgRouting/pgrouting#2725
File: src/coloring/edgeColoring_driver.cpp:87-87
Timestamp: 2025-01-19T16:17:53.496Z
Learning: Changes to error message handling in pgRouting functions require corresponding updates to pgtap tests to maintain test coverage.
pgtap/utilities/separateCrossing/issue_623.pg (1)
Learnt from: cvvergara
PR: pgRouting/pgrouting#2725
File: src/coloring/edgeColoring_driver.cpp:87-87
Timestamp: 2025-01-19T16:17:53.496Z
Learning: Changes to error message handling in pgRouting functions require corresponding updates to pgtap tests to maintain test coverage.
pgtap/utilities/separateCrossing/issue_1074.pg (1)
Learnt from: cvvergara
PR: pgRouting/pgrouting#2725
File: src/coloring/edgeColoring_driver.cpp:87-87
Timestamp: 2025-01-19T16:17:53.496Z
Learning: Changes to error message handling in pgRouting functions require corresponding updates to pgtap tests to maintain test coverage.
pgtap/utilities/separateCrossing/types_check.pg (1)
Learnt from: cvvergara
PR: pgRouting/pgrouting#2725
File: src/coloring/edgeColoring_driver.cpp:87-87
Timestamp: 2025-01-19T16:17:53.496Z
Learning: Changes to error message handling in pgRouting functions require corresponding updates to pgtap tests to maintain test coverage.
⏰ Context from checks skipped due to timeout of 90000ms (19)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Ubuntu Boost (86)
- GitHub Check: Ubuntu Boost (79)
- GitHub Check: Ubuntu Boost (84)
- GitHub Check: Ubuntu Boost (83)
- GitHub Check: Ubuntu Boost (56)
- GitHub Check: Ubuntu Boost (80)
- GitHub Check: Ubuntu Boost (77)
- GitHub Check: Ubuntu Boost (75)
- GitHub Check: Ubuntu Boost (78)
- GitHub Check: Ubuntu Boost (76)
- GitHub Check: Ubuntu Boost (68)
- GitHub Check: macos (macos-14)
- GitHub Check: Ubuntu clang
- GitHub Check: documentation (zh_Hans)
- GitHub Check: macos (macos-latest)
- GitHub Check: documentation (es)
- GitHub Check: documentation (en)
- GitHub Check: Check queries
🔇 Additional comments (24)
NEWS.md (1)
67-71
: Approve new Utilities entry for pgr_separateCrossingThe changelog under the Utilities section correctly lists issue [#2848] and the new function
pgr_separateCrossing
, consistent with the formatting of other entries. No changes needed.doc/src/release_notes.rst (1)
97-101
: Approve documentation update for Utilities sectionThe Utilities rubric now includes the entry for issue :ref:
#2848
andpgr_separateCrossing
, matching the release notes in NEWS.md. Formatting and indentation are consistent.doc/_static/page_history.js (1)
18-18
: Approve addition to page history for version 3.8The
newpages
array for version'3.8'
now includes'pgr_separateCrossing'
, ensuring the new documentation page appears in the history. The ordering is alphabetical and aligned with existing entries.doc/utilities/CMakeLists.txt (1)
3-3
: Approve CMakeLists inclusion of new .rst fileAdding
pgr_separateCrossing.rst
toLOCAL_FILES
ensures the new utility documentation is picked up by the build. This is consistent with the pattern for other utilities.docqueries/utilities/CMakeLists.txt (1)
3-4
: Correctly added new utility function to LOCAL_FILES list.The addition of
separateCrossing
to the local files list properly integrates the new utility function into the documentation build system, ensuring that its query files will be configured and included in the documentation.docqueries/utilities/test.conf (1)
6-7
: Properly integrated new test file.The addition of
separateCrossing.pg
to the test configuration ensures that tests for the new utility function will be executed as part of the test suite.sql/utilities/CMakeLists.txt (1)
3-4
: Correctly added SQL file to build configuration.The addition of
separateCrossing.sql
to the LOCAL_FILES list ensures that the implementation of the new utility function will be properly included in the build process.doc/withPoints/pgr_withPointsCost.rst (1)
14-14
: Fixed index entry format for consistency.The addition of "- Proposed" to the index entry for "withPointsCost" aligns its formatting with other related entries in the documentation, maintaining consistency in the documentation structure.
doc/conf.py.in (1)
371-371
: Substitution for pgr_separateCrossing result tuple added
The new substitution|result-separate|
correctly defines the output schema(seq,id,sub_id,geom)
forpgr_separateCrossing
. Please verify that this macro is referenced where expected in the new utility documentation to ensure consistency.doc/src/proposed.rst (1)
83-88
: Add "Utilities" section to Proposed Functions
The inserted.. rubric:: Utilities
and the include directive pull in the utilities portion fromtopology-functions.rst
betweenutility_proposed-start
/utility_proposed-end
. Confirm those markers bracket the correct content and appear in the intended order within the Proposed Functions.doc/topology/pgr_extractVertices.rst (2)
11-11
: Reclassify pgr_extractVertices under Utilities
The index entry forpgr_extractVertices
has been moved to the Utilities category, matching the overall reorganization of topology helpers. This update is consistent with other utility functions.
58-58
: Fix typo in signature section
The correction from “EMTPY” to “EMPTY” is accurate. The separate| OR EMPTY SET
line aligns with the pattern used elsewhere in PgRouting docs.doc/src/routingFunctions.rst (1)
106-111
: Embed official Utilities section in routingFunctions
The new.. rubric:: Utilities
and include oftopology-functions.rst
(betweenutility_official-start
/utility_official-end
) properly consolidates the utilities docs. Ensure those markers encompass all current utility functions, including the newly addedpgr_separateCrossing
.pgtap/utilities/separateCrossing/issue_1336.pg (1)
1-60
: LGTM! Well-structured test for issue #1336.The test script is properly implemented with conditional execution based on pgRouting version, appropriate test data setup, and verification of the expected result (4 edges and 5 vertices). The transaction with rollback ensures no side effects from the test.
pgtap/utilities/separateCrossing/issue_280.pg (1)
1-56
: LGTM! Clear and concise test for issue #280.This test script effectively validates that
pgr_separateCrossing
correctly creates a vertex at the intersection point (5,5) when processing the two crossing linestrings. Good use of both edge/vertex count validation and specific point presence verification.doc/src/pgRouting-concepts.rst (1)
668-670
: Good documentation refactoring approach.Replacing the inline instructions with a centralized include directive improves maintainability. The approach allows the crossing edges fixing instructions to be maintained in a single location and reused across documentation files.
pgtap/utilities/separateCrossing/issue_1009.pg (1)
1-55
: Test looks good and verifies issue #1009 correctly.The test script properly validates that the new
pgr_separateCrossing
function correctly handles the specific geometries from issue #1009, ensuring the resulting graph has 4 edges and 5 vertices. The conditional testing based on version check is a good practice.doc/topology/topology-functions.rst (1)
40-76
: Documentation structure improved with clear organization of utility functions.The reorganization creates a dedicated "Utility functions" section, with proper categorization into official and proposed utilities. This is a clear improvement in documentation structure.
pgtap/utilities/separateCrossing/issue_1074.pg (1)
1-61
: Test looks good and verifies issue #1074 correctly.The test script properly creates a scenario with 7 LineString geometries and validates that
pgr_separateCrossing
generates the expected 14 edges and 14 vertices. The conditional testing based on version check is correctly implemented.pgtap/utilities/separateCrossing/edge_cases.pg (1)
1-105
: Comprehensive edge case testing with good validation approach.This test creates a grid pattern to thoroughly test the edge crossing functionality. The approach of verifying initial counts, applying the function with a specific tolerance, and then checking resulting edges, vertices, and direction counts is thorough and well-designed.
docqueries/src/concepts.result (1)
182-189
: Ensure regenerated result files are in sync with the newpgr_separateCrossing
logicSeveral lines in the recorded result changed (see components 13 and new edge 19).
Before merging, regenerate the .result files from a clean build to avoid Doc‑build or CI diffs caused by stale expected output.Also applies to: 284-289, 334-335
docqueries/utilities/separateCrossing.result (1)
1-132
: Well-structured example demonstrating the complete pgr_separateCrossing workflowThis result file provides an excellent demonstration of the new pgr_separateCrossing function, showing:
- Basic usage with output (lines 6-14)
- The underlying SQL via dry run mode (lines 17-53)
- The problem (no path before fixing crossings in lines 55-60)
- Identification of crossing points (lines 62-71)
- Complete workflow to fix topology (lines 73-126)
- Demonstration of successful routing after fixing (lines 116-126)
The transaction with ROLLBACK ensures the examples can be run without permanent changes.
docqueries/utilities/separateCrossing.pg (1)
1-61
: Comprehensive and well-organized example scriptThis SQL script provides a clear, step-by-step demonstration of using pgr_separateCrossing and the subsequent topology updates required. The script is logically structured to:
- Show basic function usage
- Demonstrate dry run mode
- Show the "before" state with routing failure
- Identify crossings
- Modify schema and insert split geometries
- Update costs proportionally
- Insert new vertices
- Update edge source/target references
- Show the "after" state with successful routing
The example serves as an excellent template users can adapt for their own data.
doc/utilities/pgr_separateCrossing.rst (1)
1-184
: Well-structured documentation with comprehensive examplesThe documentation follows the project's standards and provides all necessary information for users:
- Clear description of what the function does (lines 19-20, 31)
- Proper version information (lines 24-26)
- Complete function signature with parameters (lines 39-67)
- Required input structure (lines 75-80)
- Detailed examples with explanations (lines 82-172)
- Related documentation references (lines 178)
The step-by-step example of fixing an intersection is particularly valuable as it demonstrates the entire workflow from detection to topology update.
c6ac76a
to
4fc178f
Compare
9b66309
to
ad98a69
Compare
Fixes #2848 .
Changes proposed in this pull request:
pgr_nodeNetwork
pgr_separateCrossing
pgr_separateCrossing
pgr_separateCrossing
@pgRouting/admins
Summary by CodeRabbit
pgr_separateCrossing
function to automatically split crossing edges and improve network topology.pgr_separateCrossing
.