Repository navigation
fix(crs): EPSG:900913 WKT without a shift reads as PROJ does; a set-aside WGS 84 shift is said - #2961
Conversation
…WGS 84 shift is said GDAL 1's EPSG:900913 text without its PROJ4 extension and without TOWGS84 read as Web Mercator, 21 km off at 45°N from PROJ 9.9.0's ellipsoidal Mercator: the Web Mercator comparison now runs without a shift too. A file's shift on a code without one (WGS 84's) is set aside with a note. Stale test comments and a PROJ 9.8.1 citation updated. Refs opengeos#2032 (terrio-crs release)
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewPR #2961 is a one-file change to Bugs
Security
Performance
Quality
AGENTS.md
Already raised earlier: none. There are no prior review threads on this PR, so I did not skip any concerns. Change sizeCompared with main (merge base b595175 to PR head 2e9a605), covering the whole PR.
|
📖 Docs preview
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 |
…he same 900913 and set-aside rules read_wkt_over_code shares read_root's rule (by_code_note): GDAL 1's EPSG:900913 without a shift is compared with Web Mercator there too, and a shift set aside on a code without one is said. Only 900913 is compared without a shift: EPSG:3857's own text is Web Mercator for PROJ by its name, and a row coded 3857 is still read by its code.
|
Review round 1, fixed in 579342b:
|
| let beside = read_wkt_over_code(pseudo, 3857).unwrap_or(Ok((Crs::WebMercator, None))); | ||
| assert_eq!(beside, Ok((Crs::WebMercator, None))); |
There was a problem hiding this comment.
This assertion can't fail on the None case. unwrap_or(Ok((Crs::WebMercator, None))) turns None into the expected value, so the test passes whether read_wkt_over_code reads the text (Some(Ok(..))) or defers to the code (None). That is the intended outcome, but the test should say it. Asserting it directly also makes a regression to Some(Err(..)) show up with its message.
| let beside = read_wkt_over_code(pseudo, 3857).unwrap_or(Ok((Crs::WebMercator, None))); | |
| assert_eq!(beside, Ok((Crs::WebMercator, None))); | |
| let beside = read_wkt_over_code(pseudo, 3857); | |
| assert!(beside.clone().is_none_or(|r| r == Ok((Crs::WebMercator, None))), "{beside:?}"); |
Category: quality
There was a problem hiding this comment.
Merged already, so no follow-up for this: None is meant to pass. It means the caller uses the code, and 3857 is Web Mercator, so either outcome reads the text as Web Mercator with no note, which is what the test checks. A wrong reading (Some(Ok(custom)) or a note) still fails it.
Code reviewI read the diff, the changed functions in Checked: the refactor of Bugs: none found. Confidence in the logic is high on the traced paths. Security: none found. Performance: (low, not posted inline) Quality:
AGENTS.md: no breaks found. The new notes go through the shared reader and so reach every surface. The note strings are English Open question (low confidence, not verified): existing files coded Change sizeCompared with the base branch: the whole PR against main (merge base b595175 to PR head 579342b).
|
Follow-up to #2933, from its review (threads on
wkt.rs).PROJ4extension and without aTOWGS84still read as Web Mercator, becauseread_roottook the code straight away when the file gave no shift. It is now compared with Web Mercator as a shifted one is (places_asat 10°E 45°N), so it reads as Mercator on the WGS 84 ellipsoid. PROJ 9.9.0 (conda-forge, pyproj 3.8.0, network off) puts 6 679 169.4476 m E, 5 621 521.4862 m N at 60°E 45.1923152°N for it, with a shift, a shift of zero or none; the test now covers all three.TOWGS84[1,2,3]reads as EPSG:32631 (as PROJ 9.9.0 transforms it: 3°E 45.1534772°N), and now says so: "the file's own shift to WGS 84 is set aside, as EPSG:32631 has none, as in PROJ". Asserted throughread_wkt; a zero shift stays without a note.Refs #2032 (terrio-crs release)
Round 1: the same rule for a code beside the text (
read_wkt_over_code: GeoPackage, File Geodatabase, PDF), shared withread_root(by_code_note). Only 900913 is compared without a shift; a row coded 3857 is still read by its code, and 3857's own text without its extension stays Web Mercator (PROJ 9.9.0 reads it by its name). The change sits in the shared WKT reader, so it reaches every surface that opens these files (desktop, web, CLI, Python, Assistant).Summary by CodeRabbit