Skip to content

Route, Simulation and annotation made from a layer in degrees take the project's coordinate system (C3a part 3) - #2782

Merged
pick2510 merged 1 commit into
opengeos:mainfrom
pick2510:feat/crs-project-commands
Nov 23, 2026
Merged

pick2510 merged 1 commit into
opengeos:mainfrom
pick2510:feat/crs-project-commands

Conversation

@pick2510

@pick2510 pick2510 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Part 3 of C3a in #2032, after #2776 (part 2).

Part 2 holds a tool's output made in longitude/latitude in the project's coordinate system. Part 3 applies the same rule to the three engine commands that make a layer from another one, as #2776 promised.

What changes

  • Commands covered:

    • Shortest Route (analysis.route)
    • Simulation (analysis.simulate)
    • Convert Labels to Annotation (labels.convert)
  • The rule: when the source layer is in longitude/latitude, Web Mercator or another system in degrees, and the project has a coordinate system, the new layer is held in the project's system, with it as its own crs. Before, the new layer took the source's system, and it still does without a project system.

    • A source held in a projected system keeps its own, as before, as a tool's output does in part 2.
    • A geocentric project system is passed over.
  • Refusals: a place the project's system can't hold (beyond 85.05° in Web Mercator) leaves the layer in longitude/latitude, said once:

    Pts: kept in longitude/latitude, as it was made, not in the project's EPSG:3857: feature 1 has a place that can't be held in EPSG:3857

    That notice used to name the layer twice; now it names it once.

  • Cancel: a Cancel during the conversion stops the command, which adds nothing, as before.

All three go through workflows::hold_as, which now asks made_in for the system.

Memory

Each new layer is converted once through Dataset::hold_as. Since #2776, that keeps the converted geometry beside the rows and copies no attributes, so the peak is about 2× the new layer's geometry, then 1×. The layers are a route, up to 1,000,000 simulated points, or one point per label. Nothing else is copied.

Thread

The three commands already run on the session's thread, and the conversion adds to that. It looks at Cancel every 256 rows, as hold_in does. Moving Simulation onto a background thread, which its million points might call for, is out of scope here.

Surfaces

analysis.route, analysis.simulate and labels.convert are commands, so the desktop, the web app, the CLI, Python and the Assistant/MCP all reach the change. No command or parameter changes.

Docs:

  • maps.md, "The project's coordinate system"
  • analysis.md, the Simulation row
  • cartography.md, Convert

Tests

In tests/project_crs.rs:

  • layers_made_from_another_in_longitude_latitude_take_the_project_system:
    • without a project system, each new layer stays in longitude/latitude as before;
    • with LV95, each is held in LV95, at the same places within a centimetre;
    • from layers held in UTM, each stays in UTM.
  • a_layer_made_from_another_the_project_system_cant_hold_stays_in_longitude_latitude:
    • a polar polygon's points in a Web Mercator project stay in longitude/latitude, with one notice naming the layer once;
    • in a geocentric project system, they stay in longitude/latitude with nothing said.

Summary by CodeRabbit

  • Improvements
    • Shortest Route, Simulation, and Convert Labels to Annotation now store outputs in the project’s coordinate system when the source layer uses longitude/latitude or another unsupported system and the project system is suitable.
    • When the project system cannot hold an output, it remains in longitude/latitude, with a notice in applicable cases. Outputs from layers already in a projected system continue to use that system.
  • Documentation
    • Updated guidance on coordinate systems used by analysis, route, simulation, and annotation workflows.

…yer made in longitude/latitude in the project's coordinate system (C3a part 3)
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Derived outputs from Shortest Route, Simulation, and Convert Labels to Annotation can use the project coordinate system when the source system is unsupported by analysis tools. Conversion failures leave the dataset in longitude/latitude, with a notice except for cancellation.

Changes: Project coordinate system for derived outputs

Layer / File(s) Summary
Output coordinate system selection and validation
crates/engine/src/cmd/workflows.rs, crates/engine/src/tests/project_crs.rs, docs/user-guide/analysis.md, docs/user-guide/cartography.md, docs/user-guide/maps.md
made_in selects the project system when it meets the stated conditions. hold_as handles conversion cancellation and other failures. Tests cover route, simulation, and annotation outputs, including fallback cases. The user guide describes the output coordinate system rules.

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

Change: Feature

Possibly related issues

  • opengeos/RustGIS issue 2032 — This PR implements the issue’s stated project-CRS output support for Shortest Route and Simulation.

Possibly related PRs

  • opengeos/RustGIS#2776: This PR applies the project-coordinate-system output rule to Shortest Route, Simulation, and Convert Labels to Annotation using the shared hold_as workflow.
  • opengeos/RustGIS#2667: This PR uses the optional project coordinate system setting introduced there.

Suggested reviewers: giswqs, deniial00

Merge Risk: Minimal · up to 7ffcc

Derived outputs from Shortest Route, Simulation and Convert Labels now take the project coordinate system when the source is in degrees. They fall back safely to longitude/latitude when the project system cannot hold a place. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the three commands (Shortest Route, Simulation, annotation) and the rule that outputs from a layer in degrees take the project's coordinate system. The raw summary and objectives confi…
Description check Passed The description follows the template. It has a Summary (Part 3 of C3a, the rule, the commands, refusals, cancel, memory, thread, surfaces), a Testing section listing the two new tests, and documentati…
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.
Full details: Title check

Explanation

The title names the three commands (Shortest Route, Simulation, annotation) and the rule that outputs from a layer in degrees take the project's coordinate system. The raw summary and objectives confirm this is the main change. The title is long (111 characters, 18 words) but specific and accurate.

Full details: Description check

Explanation

The description follows the template. It has a Summary (Part 3 of C3a, the rule, the commands, refusals, cancel, memory, thread, surfaces), a Testing section listing the two new tests, and documentation pointers. The UI evidence section states 'No visible UI change.', which the template allows when no visible UI change exists. The Related issue section is empty of an issue link: it references #2032 and #2776 in the body text but has no 'Closes' or 'Part of' line. The template placeholder was removed from that section, so the Related issue line is missing.

Resolution

Optionally add an explicit 'Part of #2032' line under Related issue to match the template.

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 checks the map in green,
And picks the project’s system clean.
If conversion stops, the points stay wide,
In longitude and latitude.
Then carrots mark the route outside.

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: 5c3055fd-1853-4391-8202-72a795755f66
Commits

Reviewing files that changed from the base of the PR and between 78fd00f and 7ffcc20.

Files selected for processing: 5

  • crates/engine/src/cmd/workflows.rs
  • crates/engine/src/tests/project_crs.rs
  • docs/user-guide/analysis.md
  • docs/user-guide/cartography.md
  • docs/user-guide/maps.md

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

point is found in its own coordinates, where a map in that system draws it; a moved label that
The annotation layer is held in the labelled layer's system; for a layer in
longitude/latitude, Web Mercator or another system in degrees, in the project's coordinate
system when it has one (not a geocentric one). In a projected system a label's point is found in its own coordinates, where a map in that system draws it; a moved label that

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 paragraph line runs far past the wrap width the rest of the guide uses. Rewrap the paragraph so each line stays near 100 columns.

Category: quality

@github-actions

Copy link
Copy Markdown
Contributor

Code review

I checked the three call sites (analysis.route, analysis.simulate, labels.convert), made_in/hold_as, the works_in predicate, Dataset::hold_in, the new tests, and the docs against AGENTS.md. I found no correctness bugs and no security issues. The one inline comment is a nit.

Bugs: None found. made_in and labels' own branch use the same works_in test, so they agree. The notice-prefix strip matches the error text hold_in produces. Cancel still adds nothing, since hold_as runs before add_dataset and before the source is changed. The geocentric test would fail if the filter were removed, so it discriminates. Confidence: high.

Security: None.

Performance: No new issues. The added conversion is one pass over the new layer, and the PR states its memory multiple (about 2× then 1×), consistent with hold_in.

Quality:

  • Inline on docs/user-guide/cartography.md:771: the converted paragraph has one line far past the guide's wrap width. Confidence: high. Left for the release quality pass if the author prefers.
  • Low confidence: the maps.md paragraph wrap is ragged around "project's when it is projected,". Not commented.

AGENTS.md:

  • Low–medium confidence, pre-existing and not posted inline: analysis.route, analysis.simulate and labels.convert run on the session's UI thread, and their work grows with input (Simulation allows up to 1,000,000 points). None is in the long_commands lists in crates/engine/src/tests/cancellation.rs, and their doc comments don't say why they stay on the UI thread. The PR adds a per-feature conversion pass to that path and says moving the commands off-thread is out of scope. Consider a follow-up issue.
  • Low confidence, design point: a geocentric project system is silently passed over, with no notice. The test asserts that deliberately, and the docs describe it. Worth a sentence in the PR if intentional.

Already raised earlier: 0. There are no prior review threads on this PR.

Change size

Compared with the base branch (merge base 78fd00f to PR head 7ffcc20), the whole PR against main.

Measure Value
Files changed 5 (0 added, 5 modified, 0 removed, 0 renamed)
Size before 487.2 KB
Size after 494.3 KB
Total size change +7.1 KB
Path Before After Change
crates/engine/src/tests/project_crs.rs 31.2 KB 36.7 KB +5.5 KB
crates/engine/src/cmd/workflows.rs 119.1 KB 120.3 KB +1.2 KB
docs/user-guide/cartography.md 70.4 KB 70.6 KB +155 B
docs/user-guide/maps.md 75.9 KB 75.9 KB +111 B
docs/user-guide/analysis.md 190.6 KB 190.7 KB +92 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2782/
Web app https://preview.rustgis.app/pr-2782/app/
Commit 7ffcc20

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).

@pick2510
pick2510 added this pull request to the merge queue Nov 23, 2026
Merged via the queue into opengeos:main with commit 0456dfc Nov 23, 2026
27 checks passed
@pick2510
pick2510 deleted the feat/crs-project-commands branch November 23, 2026 14:48
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