Skip to content

build(deps): terrio-crs 0.3.0 from crates.io instead of the git pin - #2933

Merged
pick2510 merged 2 commits into
opengeos:mainfrom
pick2510:terrio-crs-0.3
Nov 25, 2026
Merged

pick2510 merged 2 commits into
opengeos:mainfrom
pick2510:terrio-crs-0.3

Conversation

@pick2510

@pick2510 pick2510 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Refs #2032

RustGIS has taken terrio-crs from a git pin of opengeos/terrio (rev bbc0aae) since A1 (#2041), waiting for a release. terrio-crs 0.3.0 (terrio v0.10.0) is that release, and it contains the pinned rev. This PR moves to it.

What changes

  • The dependency: Cargo.toml now has terrio-crs = { version = "0.3.0", default-features = false }.
    • deny.toml and fuzz/deny.toml allow no git source again, as before the pin.
    • Cargo.lock and fuzz/Cargo.lock move to the registry crate. fuzz/Cargo.lock was already behind main's manifests and is refreshed with it.
  • New dependencies: 0.3.0 brings zrip (zrip, zrip-core, zrip-decode, zrip-encode), terrio's pure-Rust Zstandard. They are MIT-licensed, and cargo xtask notices regenerated the three THIRD-PARTY-LICENSES.txt files.
  • What 0.3.0 changes since the pin: 53 terrio-crs commits. Most read WKT as PROJ 9.9.0 does, from one CRS model (terrio-crs: parse CRS definitions once into a typed model (refactor proposal) terrio#1058, feat(layouts): measured grids, eastings and northings in a projected system, beside the graticule #1012). Two reference values in RustGIS's tests moved, both now matching PROJ 9.9.0:
    • A UTM 32N (EPSG:32631) WKT with TOWGS84[1,2,3] on WGS 84 itself: read as EPSG:32631, as PROJ transforms it, with no shift.
    • GDAL 1's EPSG:900913 WKT without its PROJ4 extension: this one exposed a RustGIS bug.
      • places_as decides whether a file reads as its EPSG code. It compared Web Mercator at 0°/0°, where Web Mercator's sphere and Mercator on the WGS 84 ellipsoid coincide.
      • With the shift no longer applied there, such a file read as Web Mercator, 21 km off at 45°N.
      • Web Mercator is now compared at 10°E 45°N. The file reads as Mercator on the ellipsoid, as PROJ reads it.
      • Before, it read that way only while its file gave a non-zero shift. Without a shift it was read as Web Mercator, so that case was wrong all along.

Checked against PROJ 9.9.0

The oracle is conda-forge PROJ 9.9.0 with pyproj 3.8.0 built against it, network off: Transformer.from_crs(CRS.from_wkt(text), "EPSG:4326", always_xy=True).

  • UTM 32N with TOWGS84[1,2,3]: 500 000 m E, 5 000 000 m N is 3°E 45.1534772°N, the same as EPSG:32631.
  • EPSG:900913 without the extension, with or without a shift: 6 679 169.4476 m E, 5 621 521.4862 m N is 60°E 45.1923152°N. Web Mercator would put it at 45°N.

The tests assert both.

Surfaces

Every surface reads .prj, GeoTIFF and typed WKT through the same reader: desktop, web, CLI, Python and the Assistant. No command, schema or user guide changes.

Tests

Local CI passes: fmt, clippy, the workspace tests, the layers extra, the schema check, notices, the wasm build and cargo deny. The exceptions are the four tests that fail only on my machine (three Shapefile tests and the GDAL-folder reload), which fail on main too.

Summary by CodeRabbit

  • Bug Fixes
    • Improved WKT projection handling for coordinate systems with nonzero datum shifts, including cases with EPSG authority information.
    • Web Mercator WKT without a PROJ4 extension is now interpreted as ellipsoidal Mercator, including when the datum has a nonzero shift.
    • Web Mercator comparisons now use a representative location rather than falling back to the origin. This improves projection matching and coordinate results.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The workspace now uses the published terrio-crs 0.3.0 crate instead of a pinned Git revision. License notices and Git-source policies are updated. WKT comparison behavior and tests are adjusted.

Changes: terrio-crs release and WKT behavior

Layer / File(s) Summary
Adopt the published terrio-crs release
Cargo.toml, deny.toml, fuzz/deny.toml, THIRD-PARTY-LICENSES.txt, apps/rustgis-mobile/THIRD-PARTY-LICENSES.txt, apps/rustgis-python/THIRD-PARTY-LICENSES.txt
Cargo uses terrio-crs 0.3.0 from crates.io, and both Git-source allowlists no longer permit the terrio repository. The license notices add crate and EPSG/PROJ attribution details.
Update WKT comparison and tests
crates/data/src/raster/wkt.rs
places_as compares Web Mercator at 10°E, 45°N. Tests update EPSG:32631 identification and check transformed coordinates for WKT without a PROJ4 extension.

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

Change: Other

Possibly related issues

  • opengeos/RustGIS#2032 — The issue tracks replacing the Git-pinned terrio-crs with a released version, which this change does.

Possibly related PRs

  • opengeos/RustGIS#2041 — It uses terrio-crs through a Git revision, while this change updates that dependency to the 0.3.0 release.
  • opengeos/RustGIS#2066 — It relies on terrio-crs behavior that this change updates for WKT reading.
  • opengeos/RustGIS#2409 — It uses the Git revision replaced here by terrio-crs 0.3.0.

Suggested reviewers: pawelkra, giswqs

Merge Risk: Minimal · up to ffc18 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: the terrio-crs dependency moves from a git pin to the released 0.3.0 crate on crates.io. It is specific, concise, and matches the Cargo.toml, deny.toml, and lockfile …
Description check Passed The description follows the template well. Summary explains the dependency move, the 0.3.0 changes, and the places_as fix. Testing lists local CI results and the four known machine-specific failures. …
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 states the main change: the terrio-crs dependency moves from a git pin to the released 0.3.0 crate on crates.io. It is specific, concise, and matches the Cargo.toml, deny.toml, and lockfile changes described in the summary and objectives.

Full details: Description check

Explanation

The description follows the template well. Summary explains the dependency move, the 0.3.0 changes, and the places_as fix. Testing lists local CI results and the four known machine-specific failures. The UI evidence section states 'No visible UI change.', as the template allows. The Related issue section cites 'Refs #2032'. The template's HTML comments are not present, which is acceptable.

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 at ten degrees east,
Then hops to forty-five north, where projections meet.
A crate arrives by the published road,
Its license notes now share the load.
The WKT tests follow, paws neat and fleet.

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: b12db2bf-fc76-4ade-9b55-5ffaf3ff1e34
Commits

Reviewing files that changed from the base of the PR and between e7f6bcf and ffc1852.

Files ignored due to path filters: 2

  • Cargo.lock is excluded by !**/*.lock
  • fuzz/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 7

  • Cargo.toml
  • THIRD-PARTY-LICENSES.txt
  • apps/rustgis-mobile/THIRD-PARTY-LICENSES.txt
  • apps/rustgis-python/THIRD-PARTY-LICENSES.txt
  • crates/data/src/raster/wkt.rs
  • deny.toml
  • fuzz/deny.toml

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

// Away from the equator, where Web Mercator's sphere and an ellipsoid's Mercator (World
// Mercator, or GDAL 1's EPSG:900913 without its `PROJ4` extension, as PROJ reads it) are
// 21 km apart at 45°; at the origin they meet.
Crs::WebMercator => Some(rustgis_geom::Coord::new(10.0, 45.0)),

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.

This new comparison is only reached when the file gives a shift. read_root (line 500, unchanged) returns by_code straight away when files_shift.is_none(), so a GDAL 1 EPSG:900913 WKT whose datum has no TOWGS84 clause still reads as Crs::WebMercator, the sphere, about 21 km off at 45°N. The PR body calls the no-shift case "wrong all along", so this looks like the case it means to fix. The new tests only cover a datum with TOWGS84[0,0,0,0,0,0,0], so they would not catch it. I have not run this. Suggested fix: add a regression test with a 900913 WKT that has no TOWGS84. If it reads as Web Mercator, run places_as for Crs::WebMercator even when there is no shift.

Confidence: medium (about 60%).

Category: bug

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in #2961: a Web Mercator code without a TOWGS84 now goes through places_as too, so the 900913 text without its PROJ4 extension and without a shift reads as ellipsoidal Mercator (PROJ 9.9.0: 60°E 45.1923152°N), with a test for it.

// "EPSG:4326", always_xy=True).transform(500000, 5000000)` is 3°E 45.1534772°N), as
// EPSG:32631 does.
let shifted = crs_from_wkt(&towgs84("TOWGS84[1,2,3]"));
assert_eq!(shifted, Ok(Crs::Epsg(32631)));

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.

The UTM text with TOWGS84[1,2,3] now reads as Crs::Epsg(32631), which drops the file's shift with no note. Before this PR the same text read as Crs::Custom and kept its shift. PROJ 9.9.0 ignores that shift on WGS 84, so the positions match PROJ. AGENTS.md still says a reader that drops a value must say what it dropped. This test uses crs_from_wkt, which discards the note, so it can't check that. Suggested fix: have the places_as path (read_root, around line 501) say the file's shift on WGS 84 is set aside because WGS 84 has none, and assert that note with read_wkt here.

Confidence: about 50%. I have not run the code.

Category: agents-md

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in #2961: the shift set aside on a code without one is said ("the file's own shift to WGS 84 is set aside, as EPSG:32631 has none, as in PROJ"), asserted through read_wkt; the stale comment and the 9.8.1 citation are updated there too.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Reviewed the whole diff: the terrio-crs 0.3.0 registry move, the lock files, the license notices, and crates/data/src/raster/wkt.rs. I did not build or run the tests (no shell here), so the findings below come from reading the code. Prior review threads: none, so no earlier concerns were left alone.

Bugs

  • No-shift EPSG:900913 WKT still reads as Web Mercator (wkt.rs:533, medium, about 60%). read_root returns by_code straight away when files_shift.is_none(), so the new 10°E 45°N comparison never runs for a datum with no TOWGS84 clause. The PR calls that case "wrong all along", so it looks unfixed. The new tests only use TOWGS84[0,0,0,0,0,0,0], so they would not catch it.

Security

  • None found. The new dependencies are MIT-licensed and deny.toml allows them. The lock entries are consistent, since ruzstd still has other dependents.

Performance

  • None found.

Quality

  • A stale comment in the test at wkt.rs:4886 says a WGS 84 code is kept "not with another" shift. The new assertion at 4896 now expects the other case too.
  • The test comment at wkt.rs:5127 still cites PROJ 9.8.1, while the rest of the PR cites 9.9.0.

AGENTS.md

  • Shift dropped without a note (wkt.rs:4896, about 50%). When places_as holds, the UTM text with TOWGS84[1,2,3] now reads as Crs::Epsg(32631) with no note about the dropped shift. Before this PR it read as Crs::Custom and kept the shift. PROJ 9.9.0 also ignores that shift, so the positions match PROJ. The rule is still "say what was dropped", and the test discards the note, so it can't check this.

Not verified: the wasm32-unknown-unknown build with zrip and fearless_simd newly in the dependency graph. CI's wasm job should settle it.

Change size

Compared with main (merge base 7f46f28 to PR head ffc1852). The sizes are whole-file sizes, not line counts.

Measure Value
Files changed 9 (modified 9, added 0, removed 0, renamed 0)
Size before 2.57 MB
Size after 2.58 MB
Total size change +12.3 KB
File Before After Change
fuzz/Cargo.lock 103.0 KB 108.1 KB +5.1 KB
crates/data/src/raster/wkt.rs 353.3 KB 355.1 KB +1.8 KB
THIRD-PARTY-LICENSES.txt 718.6 KB 720.2 KB +1.6 KB
apps/rustgis-mobile/THIRD-PARTY-LICENSES.txt 630.5 KB 632.1 KB +1.6 KB
apps/rustgis-python/THIRD-PARTY-LICENSES.txt 613.0 KB 614.6 KB +1.6 KB
Cargo.lock 203.0 KB 203.9 KB +0.9 KB
Cargo.toml 9.0 KB 8.8 KB -198 B
deny.toml 1.1 KB 1.0 KB -133 B
fuzz/deny.toml 1.1 KB 1.0 KB -133 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2933/
Web app https://preview.rustgis.app/pr-2933/app/
Commit ffc1852

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 25, 2026
Merged via the queue into opengeos:main with commit b595175 Nov 25, 2026
40 checks passed
@pick2510
pick2510 deleted the terrio-crs-0.3 branch November 25, 2026 18:08
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