Skip to content

fix(data): planetary CRS tests match equidistant cylindrical on its ellipsoid (main CI) - #1588

Closed
giswqs wants to merge 1 commit into
mainfrom
fix/planetary-crs-main-ci
Closed

giswqs wants to merge 1 commit into
mainfrom
fix/planetary-crs-main-ci

Conversation

@giswqs

@giswqs giswqs commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Fixes the red CI on main (run 42443783322, every test job).

Cause

Two PRs merged close together and their tests disagree:

Failures on all four platforms:

  • planetographic_systems_without_east_axes_are_refused: eqc_easting: Coord { x: -133.8, y: 18.859… } instead of 18.65
  • a_mars_projection_in_a_geotiff_is_said_or_refused: unwrap_err() on an Ok raster (CT 23 now read)

Fix

Test-only. The fixtures projected on the Mars 2015 planetographic ellipsoid (three cases) and on WGS 84 (the Earth westing case) now compute their metres with rustgis_geom::EquidistantCylindrical, as main reads them; the sphere cases are unchanged. The unread-transformation case uses CT 26 (New Zealand Map Grid). What each test checks (axes, refusals, planetary notices) is unchanged.

Whether reading eqc on an ellipsoid differently from PROJ/GDAL (which compute it on a sphere) is right is a behaviour question, filed as #1586.

Evidence

cargo test -p rustgis-data --test planetary_crs: 17 passed (2 failed on main). fmt and clippy pass.

Summary by CodeRabbit

  • Tests
    • Updated projection test cases to use ellipsoidal coordinates for Mars and Earth.
    • Adjusted the GeoTIFF refusal test to check transformation code 26.

…ellipsoid and an unread GeoTIFF transformation

#1478's fixtures computed Mars and Earth equidistant cylindrical metres on a
sphere and used GeoTIFF CT 23 as an unread transformation. #1463, merged
alongside, computes eqc on the ellipsoid (EPSG 1028) and reads CT 23 as
Robinson, so both tests failed on main on every platform.
@giswqs giswqs added the ci:full Run the macOS and Windows CI jobs and the release build on this pull request label Nov 8, 2026
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The planetary CRS tests now generate Mars and WGS 84 projected coordinates with ellipsoidal calculations in the specified cases. The unread GeoTIFF transformation test now uses transformation code 26 and expects the corresponding error text.

Changes: Planetary CRS test updates

Layer / File(s) Summary
Update planetary CRS test fixtures
crates/data/tests/planetary_crs.rs
Mars and Earth west-axis projection fixtures use ellipsoidal coordinates. The unread GeoTIFF transformation case uses code 26 and expects an error identifying transformation 26.

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

Change: Other

Possibly related issues

  • opengeos/RustGIS#1448: This PR updates planetary equidistant cylindrical test fixtures to use ellipsoidal coordinates.
  • opengeos/RustGIS#1586: This PR changes the fixture values involved in the open question about ellipsoidal EQC behavior, but does not resolve that question.

Possibly related PRs

  • opengeos/RustGIS#1587: This PR makes overlapping updates to the same planetary CRS test expectations.
  • opengeos/RustGIS#1478: This PR introduced the planetary CRS tests and unread GeoTIFF transformation check updated here.
  • opengeos/RustGIS#1463: This PR added the ellipsoidal EquidistantCylindrical behavior used to generate the updated test coordinates.

Suggested reviewers: pawelkra

Merge Risk: Minimal · up to 02743

The fixture updates are mergeable after normal checks. Independent coordinate fixtures and Mars-specific Robinson GeoTIFF coverage would improve regression protection but are not merge blockers.

- [ ] 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 Mars coordinates by moonlight.
Earth’s westward numbers follow an ellipsoid’s curve.
Transformation twenty-six gets its name in the test.
The little paws hop through each changed fixture.
Then carrots celebrate the passing suite.

// The same points projected on the planetographic ellipsoid, as RustGIS computes an
// equidistant cylindrical projection on an ellipsoid (EPSG method 1028).
let f = 1.0 / 169.894447223612;
let on_ellipsoid = rustgis_geom::EquidistantCylindrical::new(r, f * (2.0 - f), 0.0, 0.0, 0.0, 0.0, 0.0).unwrap();

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.

Quality / test coverage (confidence: medium). The new fixture metres come from rustgis_geom::EquidistantCylindrical, the same code the reader uses, so the round trip cannot catch an error in that projection. The PR body says whether reading eqc on an ellipsoid is right is still open (#1586), and these assertions now pin that behaviour. Consider one hard-coded reference value per datum, worked out independently (for example from the GN7-2 formula, or a published PROJ result), next to the computed fixtures. Left for the release quality pass if you prefer; it doesn't block the CI fix.

assert_eq!(said(&src.info().notes), 1, "{:?}", src.info().notes);
let a = 6_378_137.0f64;
let earth_metres = LONLAT.map(|(lon, lat)| (a * lon.to_radians(), a * lat.to_radians()));
let f = 1.0 / 298.257223563;

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 (confidence: high, left for the release quality pass). This let f shadows the earlier let f in the same function, and the two blocks that turn lon/lat into ellipsoidal metres are near-copies. A small helper, such as fn ellipsoid_metres(a: f64, inv_f: f64, lonlat: [(f64, f64); 2]) -> [(f64, f64); 2], would remove both.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Code review

No bugs, security issues, or AGENTS.md violations found. The change is test-only (one file, crates/data/tests/planetary_crs.rs). I checked that the fixtures use the same ellipsoid parameters as the reader in crates/data/src/raster/crs.rs (es = f(2−f), lat0/lon0/x0/y0 = 0 for these fixtures). I checked that rustgis_geom is a regular dependency of rustgis-data and that EquidistantCylindrical is re-exported. I checked that CT 26 is not in the reader's supported list (geotiff.rs around line 397–420), so the refusal test still exercises the unread path. The unwrap() calls are in integration-test code, which the existing file already uses. I did not run the tests, because this session has no shell.

Bugs: none found.

Security: none found.

Performance: none found.

Quality (left for the release quality pass per AGENTS.md; neither blocks the CI fix):

  • Confidence medium: the new ellipsoidal fixtures are computed by the same EquidistantCylindrical code the reader uses. The round trip therefore can't catch an error in that projection, and the test now pins the behaviour that Equidistant cylindrical on an ellipsoid: RustGIS now differs from PROJ/GDAL (since #1463) #1586 still questions. Inline comment posted at planetary_crs.rs:146.
  • Confidence high: the second let f shadows the first in the same function, and the two lon/lat→metres blocks are near-copies. A small helper would remove both. Inline comment posted at planetary_crs.rs:250.

AGENTS.md: compliant. Test-only change, no new dependency, no user-visible text, and rustfmt.toml allows max_width = 140, which the new lines fit within.

Prior reviews: no existing threads, so none were left alone.

Change size

Compared: the whole PR against main (merge base d866893 to PR head 027439d).

Measure Value
Files changed 1 (0 added, 1 modified, 0 removed, 0 renamed)
Size before 57.1 KB
Size after 57.8 KB
Total size change +694 B
Path Before After Change
crates/data/tests/planetary_crs.rs 57.1 KB 57.8 KB +694 B

@giswqs

giswqs commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

Duplicate of #1587 (same fix, opened first). The behaviour question it raised is #1586.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the macOS and Windows CI jobs and the release build on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant