Skip to content

fix(analysis): report the assumed XY coordinate system - #3454

Merged
Mavrick-F merged 2 commits into
opengeos:mainfrom
Mavrick-F:fix/table-xy-notices
Nov 30, 2026
Merged

Mavrick-F merged 2 commits into
opengeos:mainfrom
Mavrick-F:fix/table-xy-notices

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Summary

XY Table To Point now says when it assumes WGS 84 because no coordinate system was given. Explicit text coordinate systems keep their existing behavior; non-text values are refused with “crs must be text”. The resulting points and exported bytes are unchanged.

The shared tool result reaches the desktop, browser, phone, CLI, Python, Assistant, MCP and plugins through the existing tool command. No new parameter, saved format or dependency is introduced, and the change holds no additional feature rows. The generated layer can still be removed or undone.

Validation

The original eleven-case check covered empty, whitespace and explicit coordinate systems across CLI, Python and the tool pane; ten successful exports were byte-identical. Independent Sol review approved that exact patch. On main b0a271707, the missing-notice regression failed with the fix removed and passed after restoration; the existing file-output regression, formatting and test hygiene passed. Fork CI passed on 4b775719e2.

The review fix in 9962be862f passed the numeric-CRS regression (red before the guard, green after it) and fork CI. Current-head public checks are running.

UI evidence

The same tool run with an empty Coordinate System field, before and after the notice:

Before

After

Part of #1998.

Summary by CodeRabbit

  • Updates
    • The XY Table To Point tool now leaves the coordinate system blank by default. When left blank, it continues to use longitude and latitude and displays a message that WGS 84 was assumed. Explicitly selecting EPSG:4326 does not display that message.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The XY Table To Point tool now defaults its Coordinate System parameter to empty. It continues to use longitude and latitude in that case and adds a message that WGS 84 was assumed. The tool rejects non-text CRS values. Tests cover empty, whitespace, and explicit EPSG:4326 values.

Changes: XY Table To Point coordinate system

Layer / File(s) Summary
CRS default, assumption notice, and tests
crates/analysis/src/tools.rs
The Coordinate System default is empty. The tool rejects non-text CRS values and adds a WGS 84 assumption message when the trimmed parameter is empty. Tests confirm the message is absent when EPSG:4326 is explicit.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related issues

  • RustGIS issue 1998: This change adds the WGS 84 assumption notice for an empty Coordinate System. The issue’s NAD83 datum concern remains unchanged.

Suggested reviewers: pick2510, giswqs

Merge Risk: Minimal · up to 9962b

XY Table To Point now reports when it assumes WGS 84 because no coordinate system was given. Explicit coordinate systems and the output points are unchanged. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: XY Table To Point now reports when it assumes a coordinate system. The raw summary confirms the empty default, the WGS 84 assumption message, and the tests for that me…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template, with Summary, Testing, UI evidence, and Related issue sections all present. The Summary explains the change: XY Table To Point now reports when it assu…
Full details: Title check

Explanation

The title names the main change: XY Table To Point now reports when it assumes a coordinate system. The raw summary confirms the empty default, the WGS 84 assumption message, and the tests for that message. The title is specific and matches the changeset.

Full details: Description check

Explanation

The description follows the repository template, with Summary, Testing, UI evidence, and Related issue sections all present. The Summary explains the change: XY Table To Point now reports when it assumes WGS 84 without a coordinate system, and non-text CRS values are refused. The Testing section lists the eleven-case check, byte-identical exports, the failing and passing regression test, formatting checks, and fork CI. The UI evidence section includes before and after screenshots, and the related issue is given as Part of #1998. Minor gap: the Testing section is written as a narrative, and the template's example commands (such as cargo xtask ci) are not named. The description does not mention the new CRS default change in the raw summary (the default changed from explicit EPSG:4326 to empty), so reviewers may want that stated explicitly.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit plots a point with care,
With longitude and latitude there.
If CRS text is left away,
WGS 84 is named today.
Whitespace gets the same clear note,
And explicit EPSG stays afloat.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7e125999-a2d0-4f96-be4e-09404b89ac27
Commits

Reviewing files that changed from the base of the PR and between 4b77571 and 9962be8.

Files selected for processing: 1

  • crates/analysis/src/tools.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

};
let (xi, yi) = (field("x")?, field("y")?);
let (crs, crs_note) = match s(p, "crs").trim() {
let crs_text = s(p, "crs").trim();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A numeric crs (for example "crs": 3857) is read by s() as empty, so it is silently ignored and the points are placed as longitude/latitude. The new notice then says "no coordinate system was given", which is wrong for this input: one was given and dropped. raster_crs_of already refuses this case with "crs must be text"; the same check belongs here, before crs_text is read. A regression case would go in the junk-parameter list of places_rows_by_their_coordinates, e.g. {"input": "stops", "x": "lon", "y": "lat", "crs": 3857} expected to be an error.

Suggested change
let crs_text = s(p, "crs").trim();
if p.get("crs").is_some_and(|v| !v.is_null() && !v.is_string()) {
return Err("crs must be text".into());
}
let crs_text = s(p, "crs").trim();

Category: bug

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 9962be862f. XY Table To Point now rejects a non-null, non-string crs with "crs must be text", matching the existing raster guard. The regression using numeric 3857 failed before the guard and passes with it. Missing/null/blank values retain the default path; explicit text coordinate systems are unchanged. The named regression, formatting, test hygiene, normal hooks and fork CI passed.

Comment thread crates/analysis/src/tools.rs Outdated
Ok((crs, rustgis_data::raster::wkt::typed_crs_note(text, crs)))
}

/// Places points from two fields, whose system is independent of any input layer geometry.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: this doc comment is hard to parse. Something like "Places points from two numeric fields, in the system crs names (longitude/latitude when empty), whatever system the input layer has." says what the function does more directly. Left for the release quality pass if you prefer.

Category: quality

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Included in 9962be862f: the comment now describes the X/Y fields' requested coordinate system and its longitude/latitude default, and states separately that the input layer's geometry system does not determine those coordinates.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Scope: one file, crates/analysis/src/tools.rs. The change makes XY Table To Point say when it assumes WGS 84 because crs is empty, and changes the parameter default from "EPSG:4326" to "". Empty and explicit EPSG:4326 both resolve to Crs::LonLat, so the placed points are unchanged. The notice goes through ToolResult::messages, which is the right channel under AGENTS.md. Both the notice and the no-notice paths are tested.

Bugs

  • A numeric crs (e.g. "crs": 3857) is read by s() as empty. It is silently ignored, the points are placed as longitude/latitude, and the new notice says "no coordinate system was given", which is wrong for this input. raster_crs_of already rejects this with "crs must be text". Suggested fix and a regression case are in the inline comment at tools.rs:4701. Confidence: high. Category: bug.

Security

  • None found.

Performance

  • None found.

Quality

  • The new doc comment on xy_table_to_point (tools.rs:4693) is hard to parse. Nit, left in the inline comment. Confidence: high.

AGENTS.md

  • None found. The notice is one message with no count needed, and the change adds no parameter, command, saved format or dependency. The command-surface snapshot and schema are unaffected. The touched tests pass both ways.

Twins checked

  • The empty-crs branches in raster_crs_of and in_its_units already emit notes, so no change is needed there.
  • No other tool in the overlay, layer.add*, project.* or wasm families is touched by this diff.
  • I did not audit every other tool's crs default.

Earlier concerns: none. prior-reviews.json has no threads, so nothing was left alone.

Change size

Compared: the whole PR against main (merge base b0a2717 to PR head 4b77571).

Measure Value
Files changed 1 (0 added, 1 modified, 0 removed, 0 renamed)
Size before 996.4 KB
Size after 997.1 KB
Total size change +632 B
Path Before After Change
crates/analysis/src/tools.rs 996.4 KB 997.1 KB +632 B

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3454/
Web app https://preview.rustgis.app/pr-3454/app/
Commit 9962be8

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

@github-actions

Copy link
Copy Markdown
Contributor

Code review

No new findings. I did not post any inline comments.

Bugs: None found. The default change from "EPSG:4326" to "" keeps the same placement, since an empty crs already meant longitude/latitude. The new notice is emitted once, only on the empty-crs path, and the explicit EPSG:4326 path stays silent. Whitespace-only crs is trimmed and treated as empty, and the new test covers it.

Security: None found. The new non-string check rejects arrays, booleans and numbers before parsing.

Performance: None found. The change adds one branch and one push, with no per-row work.

Quality: One nit, left alone. The doc comment at crates/analysis/src/tools.rs:4693 was already raised in an earlier thread, and that thread is outdated. I'm leaving it for the release quality pass, as that thread suggests.

AGENTS.md: None found. The change has no unwrap, expect or unsafe, and the new test uses a fixed expected value. The PR body gives before and after screenshots for the visible notice and says which surfaces it reaches.

Already raised, left alone (2 earlier threads):

  • The numeric crs silently ignored, marked as a bug. The current head already has the fix: the "crs must be text" check at tools.rs:4702 and the junk-parameter assertion at tools.rs:13977. The concern is resolved in this push and I have not re-raised it.
  • The doc-comment wording, marked quality. Covered in the Quality note above.

Twins checked:

  • raster_crs_of (tools.rs:5822) already applies the same "crs must be text" check, so the two read routes now match.
  • The overlay tools, layer-add and project-open families are not touched by this diff.
  • The Tools pane, CLI, Python and Assistant all reach xyTableToPoint through the same spec. docs/user-guide/data.md and analysis.md do not state the old default, so they need no update.

I could not build or run the tests in this environment, since I have no shell. The findings above come from reading the diff and the surrounding source.

Change size

Compared with the base branch: the whole PR against main (merge base b0a2717 to PR head 9962be8).

Measure Value
Files changed 1 (0 added, 1 modified, 0 removed, 0 renamed)
Size before 996.4 KB
Size after 997.4 KB
Total size change +967 B
Path Before After Change
crates/analysis/src/tools.rs 996.4 KB 997.4 KB +967 B

@Mavrick-F
Mavrick-F added this pull request to the merge queue Nov 30, 2026
Merged via the queue into opengeos:main with commit 5253c71 Nov 30, 2026
30 checks passed
@Mavrick-F
Mavrick-F deleted the fix/table-xy-notices branch November 30, 2026 15:48
@Mavrick-F Mavrick-F mentioned this pull request Nov 30, 2026
56 of 63 tasks
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.

1 participant