Skip to content

Conversation

@cvvergara
Copy link
Member

@cvvergara cvvergara commented Oct 7, 2025

Changes proposed in this pull request:

  • Using pgRouting new function to find the closest edges: pgr_findCloseEdges
  • Using pgRouting new function to route using points: pgr_withPoints

@pgRouting/admins

Summary by CodeRabbit

  • New Features
    • Added a “Routing with Points” chapter with step-by-step examples, scripts, and generated outputs, including new images and views for vehicle, taxi, and walk networks.
  • Documentation
    • Replaced the old basic chapter with the new “withPoints” guide; updated index navigation and image sets.
  • Localization
    • Added/updated translations and templates for English, Spanish, and Swedish; removed obsolete resources.
  • Chores
    • Updated sample map coordinates and removed deprecated files and build entries related to the retired chapter.

@cvvergara cvvergara added this to the FOSS4G 2025 milestone Oct 7, 2025
@cvvergara cvvergara requested a review from robe2 October 7, 2025 15:22
@coderabbitai
Copy link

coderabbitai bot commented Oct 7, 2025

Warning

Rate limit exceeded

@cvvergara has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 4 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between c290585 and e349251.

📒 Files selected for processing (8)
  • docs/basic/sql_function.rst (1 hunks)
  • docs/basic/withPoints.rst (1 hunks)
  • locale/en/LC_MESSAGES/basic/sql_function.po (1 hunks)
  • locale/en/LC_MESSAGES/basic/withPoints.po (1 hunks)
  • locale/es/LC_MESSAGES/basic/sql_function.po (1 hunks)
  • locale/pot/basic/sql_function.pot (1 hunks)
  • locale/pot/basic/withPoints.pot (1 hunks)
  • locale/sv/LC_MESSAGES/basic/sql_function.po (1 hunks)

Walkthrough

Replaces the “plpgsql_function” chapter with a new “withPoints” chapter across docs, scripts, images, locales, and build config. Adds a new PL/pgSQL function wrk_withPoints, associated scripts, images, and views; removes prior plpgsql functions, scripts, docs, and locales. Updates two coordinate constants.

Changes

Cohort / File(s) Summary
Config constants
CMakeLists.txt
Updated POINT1/POINT2 LAT/LON values; removed obsolete comments.
Docs chapter switch
docs/basic/CMakeLists.txt, docs/index.rst
Replaced chapter reference from plpgsql_function.rst to withPoints.rst.
Docs images plumbing
docs/basic/images/CMakeLists.txt, docs/basic/images/withPoints/CMakeLists.txt, docs/basic/images/withPoints/*
Switched image subdir from plpgsql_function to withPoints; trimmed image list to two files.
RST content replace
docs/basic/plpgsql_function.rst, docs/basic/withPoints.rst
Removed plpgsql_function documentation; added withPoints documentation with exercises and examples.
Scripts routing: chapter list/deps
docs/scripts/basic/CMakeLists.txt
Replaced script directory entry and dependencies from plpgsql_function to withPoints.
Scripts removed (old chapter)
docs/scripts/basic/plpgsql_function/CMakeLists.txt, docs/scripts/basic/plpgsql_function/plpgsql_function.sql
Deleted custom target, generated artifacts, and SQL defining wrk_Nearest, wrk_fromAtoB, views, and exercises.
Scripts added (new chapter)
docs/scripts/basic/withPoints/CMakeLists.txt, docs/scripts/basic/withPoints/withPoints.sql, docs/scripts/basic/withPoints/images.sql
Added target to run withPoints SQL; introduced wrk_withPoints function, supporting usage blocks, points/closest edges tables, and views (using_vehicle/taxi/walk).
Locales removed (old chapter)
locale/en/LC_MESSAGES/basic/plpgsql_function.po, locale/pot/basic/plpgsql_function.pot
Deleted PO/POT for plpgsql_function.
Locales added/updated (new chapter)
locale/en/LC_MESSAGES/basic/withPoints.po, locale/es/LC_MESSAGES/basic/withPoints.po, locale/sv/LC_MESSAGES/basic/withPoints.po, locale/pot/basic/withPoints.pot
Added POT/POs and updated translations for withPoints chapter.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant PSQL as psql
  participant DB as PostgreSQL + PostGIS
  participant FN as wrk_withPoints()
  participant PGR as pgRouting

  Dev->>PSQL: Run withPoints.sql
  PSQL->>DB: CREATE FUNCTION wrk_withPoints(...)
  Dev->>PSQL: Run images.sql
  PSQL->>DB: CREATE tables/views (points_on_map, closest_walk, using_*)

  Note over FN,PGR: Route computation flow
  Dev->>PSQL: SELECT * FROM wrk_withPoints(edges_subset, p1, p2, do_debug)
  PSQL->>DB: Execute function
  DB->>FN: Invoke wrk_withPoints
  FN->>PGR: pgr_findCloseEdges(edges_subset, point1/point2)
  PGR-->>FN: Closest edges to points
  FN->>PGR: pgr_withPoints(edges_subset, points/edges)
  PGR-->>FN: Route rows (seq, id, cost, geom, ...)
  FN-->>PSQL: Return route with azimuth and readable text
  PSQL-->>Dev: Results/Views materialized
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • robe2
  • iosefa

Poem

A hop, a skip—new points in sight,
I nibble paths by moonlit byte.
Old burrows closed, new trails begin,
With wrk_withPoints, I’m bounding in.
Two dots, one route—so neat, so tight—
Thump-thump, compiled; the map feels right. 🐇🗺️

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title “Withpoints chapter” is a brief phrase that matches the addition of the withPoints documentation but does not clearly convey the primary change or context of adding pgr_findCloseEdges and pgr_withPoints examples, making it overly generic. Consider renaming the title to explicitly reference the addition of the withPoints documentation and new pgr_findCloseEdges and pgr_withPoints examples, such as “Add WithPoints chapter for pgr_findCloseEdges and pgr_withPoints documentation.”
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Nitpick comments (1)
docs/scripts/basic/withPoints/withPoints.sql (1)

48-48: Fix typo: "resuts_query" should be "results_query".

The variable name contains a typographical error. This typo is also present at lines 68 and 99 where the variable is used.

Apply this diff:

 DECLARE
   closest_query TEXT;
-  resuts_query TEXT;
+  results_query TEXT;
   additional_query TEXT;
   final_query TEXT;

And update the usage at line 68:

-  resuts_query := format(
+  results_query := format(
     $$SELECT seq, edge AS id, node, cost AS seconds

And at line 99:

   final_query :=
     'WITH
-    results AS (' || resuts_query || '),
+    results AS (' || results_query || '),
     additional AS ( ' || additional_query || ')
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 656fbf5 and c290585.

⛔ Files ignored due to path filters (7)
  • docs/basic/images/plpgsql_function/ch8-e7.png is excluded by !**/*.png
  • docs/basic/images/plpgsql_function/ch8-taxinet.png is excluded by !**/*.png
  • docs/basic/images/plpgsql_function/ch8-vehiclenet.png is excluded by !**/*.png
  • docs/basic/images/plpgsql_function/ch8-walknet.png is excluded by !**/*.png
  • docs/basic/images/plpgsql_function/closest_vertex.png is excluded by !**/*.png
  • docs/basic/images/withPoints/points_on_map.png is excluded by !**/*.png
  • docs/basic/images/withPoints/points_routing.png is excluded by !**/*.png
📒 Files selected for processing (19)
  • CMakeLists.txt (1 hunks)
  • docs/basic/CMakeLists.txt (1 hunks)
  • docs/basic/images/CMakeLists.txt (1 hunks)
  • docs/basic/images/withPoints/CMakeLists.txt (1 hunks)
  • docs/basic/plpgsql_function.rst (0 hunks)
  • docs/basic/withPoints.rst (1 hunks)
  • docs/index.rst (1 hunks)
  • docs/scripts/basic/CMakeLists.txt (2 hunks)
  • docs/scripts/basic/plpgsql_function/CMakeLists.txt (0 hunks)
  • docs/scripts/basic/plpgsql_function/plpgsql_function.sql (0 hunks)
  • docs/scripts/basic/withPoints/CMakeLists.txt (1 hunks)
  • docs/scripts/basic/withPoints/images.sql (1 hunks)
  • docs/scripts/basic/withPoints/withPoints.sql (1 hunks)
  • locale/en/LC_MESSAGES/basic/plpgsql_function.po (0 hunks)
  • locale/en/LC_MESSAGES/basic/withPoints.po (1 hunks)
  • locale/es/LC_MESSAGES/basic/withPoints.po (5 hunks)
  • locale/pot/basic/plpgsql_function.pot (0 hunks)
  • locale/pot/basic/withPoints.pot (1 hunks)
  • locale/sv/LC_MESSAGES/basic/withPoints.po (1 hunks)
💤 Files with no reviewable changes (5)
  • docs/basic/plpgsql_function.rst
  • docs/scripts/basic/plpgsql_function/CMakeLists.txt
  • locale/pot/basic/plpgsql_function.pot
  • docs/scripts/basic/plpgsql_function/plpgsql_function.sql
  • locale/en/LC_MESSAGES/basic/plpgsql_function.po
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (10)
docs/basic/images/withPoints/CMakeLists.txt (1)

6-8: LGTM!

The image file list update correctly reflects the new withPoints chapter content, replacing the previous plpgsql_function images with the new points-related imagery.

docs/basic/images/CMakeLists.txt (1)

11-11: LGTM!

The subdirectory update from plpgsql_function to withPoints correctly aligns with the chapter reorganization.

docs/index.rst (1)

38-38: LGTM!

The documentation index correctly references the new withPoints.rst chapter, ensuring proper navigation structure.

docs/basic/CMakeLists.txt (1)

14-14: LGTM!

The workshop files list correctly includes withPoints.rst, replacing the previous plpgsql_function.rst entry.

locale/sv/LC_MESSAGES/basic/withPoints.po (1)

14-730: LGTM!

The Swedish localization file has been consistently updated to reference the new withPoints.rst documentation throughout. The translation structure and references align with the chapter reorganization.

locale/es/LC_MESSAGES/basic/withPoints.po (1)

19-787: LGTM!

The Spanish localization file has been consistently updated to reference the new withPoints.rst documentation throughout. The translation structure and references align with the chapter reorganization.

docs/scripts/basic/CMakeLists.txt (2)

12-12: LGTM!

The directory list correctly includes withPoints, replacing the previous plpgsql_function entry.


28-28: LGTM!

The build dependency correctly references basic_withPoints_scripts, ensuring proper build ordering for the new chapter.

docs/scripts/basic/withPoints/images.sql (1)

1-42: LGTM!

The SQL script correctly creates visualization tables and views. The structure is clear, and the dependencies on wrk_withPoints are properly managed by the build system.

docs/scripts/basic/withPoints/CMakeLists.txt (1)

1-29: LGTM!

The CMake configuration correctly sets up the SQL scripts execution order and dependencies. The custom command properly runs withPoints.sql before images.sql, ensuring wrk_withPoints is defined before the views that use it are created.

@cvvergara
Copy link
Member Author

With this PR the basic section of the workshop rewrite is finished.
Which is going to be used on FOSS4G2025.

@cvvergara cvvergara merged commit 4d06344 into pgRouting:develop Oct 7, 2025
2 checks passed
@cvvergara cvvergara deleted the withpoints_chapter branch October 7, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants