Skip to content

Projections: draw the map in ESRI codes (#213) - #494

Merged
giswqs merged 5 commits into
mainfrom
fix/issue-213-cartographic-control
Oct 18, 2026
Merged

giswqs merged 5 commits into
mainfrom
fix/issue-213-cartographic-control

Conversation

@giswqs

@giswqs giswqs commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Point (d) of #213, by option 3 as agreed in the issue: map.projection now takes ESRI:<code> from a generated, verified table. Points (a) extent indicator style and (c) text styling are left to @elpidioassinaturas as offered.

What was wrong

map.projection only took presets, EPSG: codes and local:lon,lat, so ESRI:102033 (South America Albers, the issue's example) failed with unknown projection 'ESRI:102033'. crs-definitions has no ESRI authority.

The fix

  • crates/data/src/raster/esri.rs: 1,983 ESRI projected systems, built like epsg_gap.rs. They were generated from PROJ 9.7.1's database with pyproj 3.7.2 (deprecated codes included, because ArcGIS still writes them; each is marked in the comment). Each definition was projected at two points of its area of use by RustGIS's Projector and by pyproj, and kept only when the two agree within 1 m.
  • Left out: 170 codes whose method proj4rs lacks or that need NAD27 grids; six world systems RustGIS computes on a sphere where PROJ differs by kilometres (World Miller 54003, the WGS 84 Equal Earths 54035-54037, Winkel Tripel NGS 53042/54042); 44 whose datum shift isn't a single Helmert; 11 planetary systems; and 9 that PROJ can't write as a PROJ string. The header of esri.rs lists the reasons.
  • Datum shifts follow the epsg_gap.rs rule: the first grid-free Helmert PROJ lists, written as +towgs84. Where PROJ would pick a regional transformation for a place, the result can be a few metres away (up to about 10 m for ED50 in Turkey, Bogota 1975 or SAD69). This is documented in the header.
  • world.rs projections now read +R, so ESRI's Sphere_* systems (6371 km spheres) match PROJ instead of using the WGS 84 radius.
  • ESRI:102100 and ESRI:102113 resolve to the default Web Mercator map. A code is saved as ESRI:<n>.
  • UI: the Coordinate System dialog's code field and Settings › Start-up › Projection take ESRI:… (a bare number is still an EPSG code), and the epsg.io link goes to the ESRI page.
  • Docs: maps, workspace, installation (?projection=), comparison.

Tests

  • rustgis-data esri_table_is_sound: the table is sorted, holds only projected systems, has 102033, and leaves out 54003, the Moon, Hammer-Aitoff and invalid codes.
  • rustgis-map esri_codes: 102033, 54030, 53030 (its own sphere) and 102718 (US feet) are checked against pyproj with a round trip; it also checks labels, canonical codes, Web Mercator aliases, malformed codes, and that every entry in the table builds a projector. every_world_projection_wraps_opposite_its_central_meridian now covers the ESRI world systems too.
  • rustgis-engine esri_projection_codes: map.projection {"type":"esri:102033"} switches, keeps the centre, renders and saves; a code the table leaves out is refused and the map keeps its projection.

Note for merging: the commit message says Fixes #213, but this PR covers only point (d). Please remove that line from the squash message so the issue stays open for (a) and (c).

Part of #213

Summary by CodeRabbit

  • New Features
    • Added support for projected ESRI coordinate systems alongside EPSG codes. Enter ESRI codes in the coordinate-system dialog, at startup, or through the map projection setting.
    • Added support for ESRI projection definitions, including custom earth radii where specified.
    • Recognized additional Web Mercator code aliases.
  • Bug Fixes
    • Unsupported or invalid coordinate-system codes now return an error instead of being treated as a valid projection.
  • Documentation
    • Updated projection guidance with ESRI code examples and notes on unsupported systems.

map.projection now takes ESRI:<code>, such as ESRI:102033 (South
America Albers Equal Area Conic) or ESRI:54030 (World Robinson), from a
built-in table of 1,983 of Esri's projected systems. Like epsg_gap.rs,
the table is generated from PROJ's database with pyproj, and each entry
was kept only when RustGIS's projector and pyproj agree within 1 m at
two points of its area of use. Methods proj4rs lacks, NAD27 grids,
non-Helmert datum shifts and planetary bodies are left out.

The built-in world projections now read +R, so ESRI's Sphere_* systems
(6371 km spheres) match PROJ. ESRI:102100 and 102113 are Web Mercator.
The Coordinate System dialog and the start-up projection take ESRI
codes too.

Fixes #213
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a7ef7fbb-ad7b-47d3-bc47-1aa7f2e18044
📥 Commits

Reviewing files that changed from the base of the PR and between 2339496 and 48b311e.

📒 Files selected for processing: 4
  • ATTRIBUTION.md
  • crates/map/src/projection.rs
  • crates/ui-egui/src/ribbon.rs
  • crates/ui-egui/src/widgets.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 07fc3feb-0aa3-45a7-a963-4e85bd1f7615
📥 Commits

Reviewing files that changed from the base of the PR and between aaf833f and 2339496.

📒 Files selected for processing: 15
  • crates/data/src/raster/crs.rs
  • crates/data/src/raster/esri.rs
  • crates/data/src/raster/mod.rs
  • crates/engine/src/cmd/navigate.rs
  • crates/engine/src/tests.rs
  • crates/map/src/globe.rs
  • crates/map/src/projection.rs
  • crates/map/src/world.rs
  • crates/ui-egui/src/dialogs.rs
  • crates/ui-egui/src/lib.rs
  • crates/ui-egui/src/ribbon.rs
  • docs/comparison/index.md
  • docs/installation.md
  • docs/user-guide/maps.md
  • docs/user-guide/workspace.md

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

📝 Walkthrough

The change adds lookup for projected ESRI coordinate systems and supports ESRI codes in map projection construction, commands, UI inputs, and documentation. World projections use a definition’s positive finite +R= value when present.

Changes: ESRI Projected CRS Support

Layer / File(s) Summary
Expose ESRI CRS definitions
crates/data/src/raster/crs.rs, crates/data/src/raster/mod.rs
The raster CRS module exposes ESRI definition lookup and ordered code iteration. Tests check table ordering, definitions, and excluded codes.
Resolve ESRI definitions in map projections
crates/map/src/projection.rs, crates/map/src/world.rs
Projection lookup accepts ESRI identifiers and returns canonical ESRI labels. World projections use a positive finite +R= value when available. Tests cover ESRI lookup, construction, and world projection behavior.
Apply and canonicalize projection codes
crates/map/src/globe.rs, crates/engine/src/cmd/navigate.rs, crates/engine/src/tests.rs
Projection::from_code resolves supported codes through lookup and recognizes Web Mercator aliases. The map command description and engine tests cover ESRI code application and rejection.
Accept ESRI codes in UI and documentation
crates/ui-egui/src/dialogs.rs, crates/ui-egui/src/lib.rs, crates/ui-egui/src/ribbon.rs, docs/comparison/index.md, docs/installation.md, docs/user-guide/*
Coordinate-system and startup projection inputs accept ESRI codes. Documentation describes ESRI support and provides examples.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~30 minutes

Change: Feature

Suggested reviewers: elpidioassinaturas, danield-s

Merge Risk: ⚪ Minimal · up to 23394

This change adds ESRI projected coordinate system support through a built-in table, the projection lookup, UI inputs and documentation. No concrete merge-blocking defect was identified in the supplied context.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main change: adding support for drawing maps using ESRI projection codes.
Description check Passed The description provides a clear summary, motivation, implementation details, testing coverage, exclusions, and the related issue. It does not use the template headings exactly, but it includes the re…
Docstring Coverage Passed Docstring coverage is 88.46% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 10 files. (4 skipped: 4…
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: Description check

Explanation

The description provides a clear summary, motivation, implementation details, testing coverage, exclusions, and the related issue. It does not use the template headings exactly, but it includes the required information and is sufficiently complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 88.46% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 10 files. (4 skipped: 4 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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 taps a code in place,
ESRI maps unfold with grace.
The world turns round a chosen sphere,
New paths appear both far and near.
I nibble docs, then hop away.

Comment @coderabbitai help to get the list of available commands.

Comment thread crates/map/src/globe.rs Resolved
Comment thread crates/ui-egui/src/dialogs.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I read the whole diff apart from the generated esri.rs table. For that file I read the header and the first ~50 entries, plus the soundness test. This was a read-only review, so I didn't build the crate or run its tests.

Bugs

  • Inconsistent canonical code (crates/map/src/globe.rs:79, confidence medium-low): from_code keeps the typed digits. esri:0102033 is stored as ESRI:0102033, while lookup labels it ESRI:102033. Two spellings of one system then compare unequal and are saved under different codes. Parsing the number and formatting it would fix this.
  • Spaced Web Mercator code (crates/map/src/globe.rs:58, confidence low): the shortcut strips spaces, so ESRI 102100 becomes esri102100 and misses the Web Mercator arm. It then fails in lookup as an unknown code, although ESRI:102100 works.

Security

  • Nothing found. The new lookup branch handles hostile input safely: it checks that the text is all digits, parses with u32::parse, and does a binary_search lookup. The +R= parsing filters out non-finite and non-positive values.

Performance

  • Nothing significant. The new tests build a Projector for each of ~1,980 codes, which should be cheap.

Quality

  • epsg.io link for ESRI codes (crates/ui-egui/src/dialogs.rs:1243, confidence low-medium): ESRI and EPSG numbers overlap (31491 to 31495, 2181 to 2187, 31917 to 31922). The link https://epsg.io/{n} has no authority, so it may open the EPSG entry while the label says ESRI:n.
  • typed_crs is pub(crate) in dialogs.rs but also used from ribbon.rs. It's fine, but it could sit with the other CRS helpers.

AGENTS.md

  • Layering and wasm: the esri table is pure data in rustgis-data, with no new std-time or egui dependencies.
  • No unwrap or panic! in non-test code. The new code uses get, binary_search_by_key and ok_or_else.
  • New UI text goes through tl!. The new string "EPSG or ESRI code" needs no catalog entry, per the repo guidelines.
  • Tests added: a table soundness test, a projector test, and an engine-level esri_projection_codes test. I didn't see a hostile-parameter regression test for ESRI: junk, but map.projection is already covered by hostile_params_never_panic.

Change size

Compared: the whole PR against main (merge base f0983b7 to PR head 0a12001).

Metric Value
Files changed 15 (1 added, 14 modified, 0 removed, 0 renamed)
Size before 1.07 MB
Size after 1.45 MB
Total size change +398.5 KB
File Before After Change
crates/data/src/raster/esri.rs 0 B 390.7 KB +390.7 KB
crates/map/src/projection.rs 41.2 KB 45.0 KB +3.8 KB
crates/data/src/raster/crs.rs 14.8 KB 16.4 KB +1.5 KB
crates/engine/src/tests.rs 485.8 KB 487.0 KB +1.2 KB
crates/ui-egui/src/dialogs.rs 59.9 KB 60.4 KB +473 B
docs/user-guide/maps.md 17.6 KB 17.9 KB +332 B
crates/map/src/globe.rs 28.7 KB 28.9 KB +266 B
crates/map/src/world.rs 9.2 KB 9.3 KB +177 B
docs/user-guide/workspace.md 5.2 KB 5.2 KB +25 B
crates/ui-egui/src/lib.rs 162.5 KB 162.5 KB +23 B
crates/ui-egui/src/ribbon.rs 170.1 KB 170.1 KB -19 B
crates/engine/src/cmd/navigate.rs 32.8 KB 32.8 KB +14 B
crates/data/src/raster/mod.rs 33.7 KB 33.7 KB +10 B
docs/comparison/index.md 15.0 KB 15.0 KB +9 B
docs/installation.md 14.1 KB 14.1 KB +8 B

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-494/
Web app https://preview.rustgis.app/pr-494/app/
Commit 48b311e

GitHub Pages takes a minute or two to publish a new commit.

Projection::from_code saves the code as lookup names it, so
'ESRI 102033' and 'esri:0102033' are both ESRI:102033, and spaced or
zero-padded spellings of ESRI:102100 are Web Mercator too. An ESRI
code that is also an EPSG number links to epsg.io's search, whose
results tell the two apart.
Comment thread crates/ui-egui/src/dialogs.rs Resolved
Comment thread crates/map/src/globe.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Code review

This PR adds ESRI: projections to map.projection, backed by a generated table of 1,983 Esri systems (crates/data/src/raster/esri.rs). It also lets sphere-based world projections carry their own radius (+R=). I found nothing blocking. I did not build the PR or run its tests. I did not review the 400 KB generated table line by line, only its header, its ordering and soundness test, and spot checks of a few entries (102100, 102113, the 31491–31495 Germany zones).

Bugs

  • None found. Projection::from_code already validates through Projector::new before canonicalising. ESRI:102100 and 102113 are in the table, so the Web Mercator aliasing in from_code is reachable. The +R= parse is filtered for finite, positive values, and the World radius change is applied consistently in both forward and inverse.

Security

  • None found. ESRI code parsing is bounded: digits only, u32 parse errors are mapped to an error, and the table uses binary_search_by_key with get. No panic paths were added to non-test code, which fits the "never crash" rule.

Quality

  • typed_crs (crates/ui-egui/src/dialogs.rs:1171) strips EPSG: and epsg: case-sensitively. An input like Epsg:3035 becomes EPSG:Epsg:3035 and is refused. Confidence about 60%, minor. Inline comment posted with a suggestion.
  • The Web Mercator aliases are split between the early match and the ESRI check in crates/map/src/globe.rs:80. The projector is also built and then looked up again on each from_code. Confidence about 50%, nit. Inline comment posted.
  • docs/user-guide/maps.md hard-codes "1,983" codes. This will go stale if the table is regenerated. The test only asserts more than 1,900 entries. Confidence about 40%.

AGENTS.md

  • Translatable text is wrapped in tl!/i18n::fmt, and the changed label "EPSG or ESRI code" is wrapped in tl!. Missing catalog entries are allowed.
  • Layering and wasm: the data crate gains only a pure table module, with no new dependencies. Nothing below L6 uses egui.
  • Tests cover the new behaviour (esri_table_is_sound, esri_codes, esri_projection_codes, and the antimeridian loop extended to ESRI codes).
  • Assets and attribution: the table is generated from PROJ's database. ATTRIBUTION.md has no row for it, and AGENTS.md says every asset file needs one. This is a data file rather than an image or font, so confidence is only about 35%. The maintainer should confirm whether a PROJ/pyproj attribution row is needed.

Change size

Compared: the whole PR against main (merge base f0983b7 to PR head b31820f).

Metric Value
Files changed 15 (1 added, 14 modified, 0 removed, 0 renamed)
Size before 1,090.6 KB
Size after 1,490.0 KB
Total size change +399.4 KB
File Before After Change
crates/data/src/raster/esri.rs 0 B 390.7 KB +390.7 KB
crates/map/src/projection.rs 41.2 KB 45.4 KB +4.2 KB
crates/data/src/raster/crs.rs 14.8 KB 16.4 KB +1.5 KB
crates/engine/src/tests.rs 485.8 KB 487.0 KB +1.2 KB
crates/ui-egui/src/dialogs.rs 59.9 KB 60.7 KB +830 B
crates/map/src/globe.rs 28.7 KB 29.0 KB +341 B
docs/user-guide/maps.md 17.6 KB 17.9 KB +332 B
crates/map/src/world.rs 9.2 KB 9.3 KB +177 B
docs/user-guide/workspace.md 5.2 KB 5.2 KB +25 B
crates/ui-egui/src/lib.rs 162.5 KB 162.5 KB +23 B
crates/ui-egui/src/ribbon.rs 170.1 KB 170.1 KB -19 B
crates/engine/src/cmd/navigate.rs 32.8 KB 32.8 KB +14 B
crates/data/src/raster/mod.rs 33.7 KB 33.7 KB +10 B
docs/comparison/index.md 15.0 KB 15.0 KB +9 B
docs/installation.md 14.1 KB 14.1 KB +8 B

from_code checks EPSG:3857, ESRI:102100 and ESRI:102113 once, on the
code as lookup names it, so 'epsg 3857' is Web Mercator too and the
canonical code reuses that lookup. The code fields only prefix a bare
number with EPSG:, leaving 'Epsg:3035' or 'ESRI 102033' to lookup.
Comment thread crates/data/src/raster/esri.rs Resolved
Comment thread crates/map/src/projection.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Code review

This PR adds ESRI: support to map.projection: a generated table of Esri projected systems, +R sphere radius support for the world projections, and canonical code handling in Projection::from_code. I read the diff and the non-table code. I did not run the build or tests, and I did not check the generated table row by row. Its ordering and basic shape are covered by the new esri_table_is_sound test.

Bugs

  • No functional bugs found. I checked the code paths that handle typed codes:
    • Web Mercator codes: from_code maps EPSG:3857, ESRI:102100 and ESRI:102113 to the default map.
    • Canonicalisation: leading zeros and spacing are normalised.
    • Radius default: +R falls back to the WGS 84 radius when it is absent or invalid.
    • Panic safety: no new unwrap or indexing in non-test code, and esri::proj4 uses binary_search and get.

Security

  • Nothing found. The ESRI code is parsed as digits only and parse::<u32>() errors are handled.

Performance

  • The 400 KB DEFS table of &'static str entries is compiled into every build, including wasm32. It is looked up by binary search, so there is no runtime cost. Check the web bundle size budget. (low)

Quality

  • crates/map/src/projection.rs:68: the error message for malformed input such as esrifoo, ESRI: or ESRI:0 is odd. It prints a trimmed or mangled code, and ESRI:0 becomes ESRI:. (low)

AGENTS.md

  • crates/data/src/raster/esri.rs:40: the new data file has no row in ATTRIBUTION.md, which the "Assets" section requires. epsg_gap.rs is credited there. The new header cites PROJ 9.7.1 while ATTRIBUTION.md cites PROJ 9.8 for the EPSG table. (medium-high)
  • The new UI strings use tl!, and the PR doesn't need to touch the catalogs. The change doesn't break wasm. The new tests include hostile inputs (ESRI:abc, ESRI:-1, ESRI:1e5, overflow).

Change size

Compared: the whole PR against main (merge base f0983b7 to PR head 2339496)

Metric Value
Files changed 15 (1 added, 14 modified, 0 removed, 0 renamed)
Size before 1.07 MB
Size after 1.46 MB
Total size change +399.6 KB
File Before After Change
crates/data/src/raster/esri.rs 0 B 390.7 KB +390.7 KB
crates/map/src/projection.rs 41.2 KB 45.5 KB +4.3 KB
crates/data/src/raster/crs.rs 14.8 KB 16.4 KB +1.5 KB
crates/engine/src/tests.rs 485.8 KB 487.0 KB +1.2 KB
crates/ui-egui/src/dialogs.rs 59.9 KB 60.7 KB +821 B
crates/map/src/globe.rs 28.7 KB 29.2 KB +493 B
docs/user-guide/maps.md 17.6 KB 17.9 KB +332 B
crates/map/src/world.rs 9.2 KB 9.3 KB +177 B
docs/user-guide/workspace.md 5.2 KB 5.2 KB +25 B
crates/ui-egui/src/lib.rs 162.5 KB 162.5 KB +23 B
crates/ui-egui/src/ribbon.rs 170.1 KB 170.0 KB -19 B
crates/engine/src/cmd/navigate.rs 32.8 KB 32.8 KB +14 B
crates/data/src/raster/mod.rs 33.7 KB 33.7 KB +10 B
docs/comparison/index.md 15.0 KB 15.0 KB +9 B
docs/installation.md 14.1 KB 14.1 KB +8 B

ATTRIBUTION.md gets a row for esri.rs: Esri's projection-engine-db-doc
(Apache-2.0) through the PROJ 9.7.1 database. A malformed ESRI code is
named as typed, ESRI:0 keeps its zero, and other names starting with
'esri' are no longer read as codes.
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I read the whole PR except the generated ESRI table body, which I only sampled. I found no blocking problems. The PR adds ESRI: support to map.projection, the Coordinate System dialog and Start-up. It does this through a new generated table, crates/data/src/raster/esri.rs, with 1,983 entries (the count of + lines in the diff matches the docs' "1,983"). I could not build or run tests here, so everything below comes from reading the code.

Bugs

  • None found. I traced the parsing in lookup, which handles esri:, esri , esri0102033, esrifoo and overflow, with u32 parsing guarded. I also traced Projection::from_code: Web Mercator aliases (3857, EPSG 3857, ESRI:102100/102113) are now detected by label instead of by string match. None of these paths panics. (high confidence)
  • The World sphere radius now comes from +R= and falls back to MERCATOR_R. It is guarded against non-finite and non-positive values, so there is no divide-by-zero in inverse. (high)
  • Low risk, unverified: from_code no longer special-cases "3857" and "epsg:3857". Those now reach Projection::WebMercator only if lookup("3857") returns the label EPSG:3857. The new test covers "3857" and "epsg 3857", so this is probably fine, but CI should confirm it. (medium)

Security

  • Nothing found. Input is only parsed as digits and looked up in a static table. The epsg.io URL is built from digits only, and a code that can't be parsed never reaches it. (high)

Performance

  • The 400 KB of definition strings goes into every build, including the WASM bundle. That is acceptable, but worth knowing for the web download size. (low)
  • The projection round-trip test now also iterates all ESRI codes, which adds a little test time. (low)

Quality

  • docs/user-guide/maps.md hard-codes "1,983" systems. The test only asserts > 1900, so the doc can go stale when the table is regenerated. Consider wording that doesn't pin the count. (medium)
  • The new module comment in projection.rs line 4 is longer than the surrounding lines. This is a nit. (low)
  • typed_crs treats any input starting with a digit as EPSG and passes anything else through. That is fine because lookup validates it, but a typo like abc produces the generic "unknown projection" error. (low)

AGENTS.md

  • Never-crash rules: no unwrap, expect or panic! in non-test code. Hostile code strings go through checked parsing. A regression test, esri_projection_codes, was added. ✔
  • Attribution: ATTRIBUTION.md credits Esri's projection-engine-db-doc (Apache-2.0) and PROJ (MIT). ✔
  • i18n: the changed UI label is wrapped in tl!("EPSG or ESRI code"). The English fallback applies until the catalogs are updated, which AGENTS.md allows. ✔
  • Layering and WASM: rustgis-data exposes the table and rustgis-map consumes it, with no egui dependency. ✔
  • Docs: updated in maps.md, workspace.md, installation.md and comparison/index.md. ✔

Change size

Compared with: the whole PR against main (merge base f0983b7 to PR head f60226c).

Metric Value
Files changed 16 (1 added, 15 modified, 0 removed, 0 renamed)
Size before 1.07 MB
Size after 1.46 MB
Total size change +400.6 KB
File Before After Change
crates/data/src/raster/esri.rs 0 B 390.7 KB +390.7 KB
crates/map/src/projection.rs 41.2 KB 46.3 KB +5.1 KB
crates/data/src/raster/crs.rs 14.8 KB 16.4 KB +1.5 KB
crates/engine/src/tests.rs 485.8 KB 487.0 KB +1.2 KB
crates/ui-egui/src/dialogs.rs 59.9 KB 60.7 KB +821 B
crates/map/src/globe.rs 28.7 KB 29.2 KB +493 B
docs/user-guide/maps.md 17.6 KB 17.9 KB +332 B
ATTRIBUTION.md 2.9 KB 3.2 KB +313 B
crates/map/src/world.rs 9.2 KB 9.3 KB +177 B
docs/user-guide/workspace.md 5.2 KB 5.2 KB +25 B
crates/ui-egui/src/lib.rs 162.5 KB 162.5 KB +23 B
crates/ui-egui/src/ribbon.rs 170.1 KB 170.0 KB -19 B
crates/engine/src/cmd/navigate.rs 32.8 KB 32.8 KB +14 B
crates/data/src/raster/mod.rs 33.7 KB 33.7 KB +10 B
docs/comparison/index.md 15.0 KB 15.0 KB +9 B
docs/installation.md 14.1 KB 14.1 KB +8 B

(The "Total size change" row is computed from bytes_change = 410,270 B, which is +400.7 KB; the totals above are bytes_before/bytes_after converted at 1 KB = 1024 B.)

Settings › Start-up › Projection and Style › Display Filters hold a
text box, but egui menus close on any click, so clicking into the box
closed the menu before anything could be typed. They now close only on
a click outside; their buttons already close them.
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I read the full diff apart from the 1,983-row generated table in esri.rs, which I sampled and checked only structurally. I also read the surrounding code in ribbon.rs. I didn't build the code or run the tests. I found nothing that needs a change before merge, so I posted no inline comments.

Bugs

  • None found. I traced these paths:
    • ESRI: parsing in lookup: esri:, esri , esri0102033, esrifoo, empty, non-numeric, overflowing, and negative input all behave as the tests expect.
    • Projection::from_code after the Web Mercator shortcut moved into lookup (3857, epsg 3857, ESRI:102100, ESRI:102113). They all resolve to WebMercator.
    • The +R radius default and the World struct change.
    • typed_crs: a leading digit becomes an EPSG code, and anything else passes through for lookup to validate.
  • Confidence: high for these paths. Low-to-medium for anything that depends on the generated table's numeric accuracy. I can't re-verify it here, and it rests on the author's pyproj check.

Security

  • None. The new input handling uses parse::<u32> with errors mapped, and binary_search with get. There is no panic, indexing, or unwrap in the new non-test code. This fits the "never crash" rule. Confidence: high.

Performance

  • Nothing significant. The new esri_codes test and the extended world-wrap test project about 2k additional systems. That adds some test time and is acceptable.
  • The new lookup(s) call at the top of from_code runs once per call and is cheap.

Quality

  • docs/user-guide/maps.md ends its new paragraph with "…refused as unknown codes. The presets:" and then a table. It reads oddly. A short sentence such as "These are the presets:" would be clearer. Confidence: low (nit).
  • The docs hard-code "1,983" systems, while the test only asserts > 1900. The number will drift the next time the table is regenerated. I counted 1,983 rows in esri.rs, so it is correct today. Confidence: low (nit).
  • The long line in docs/user-guide/workspace.md breaks the file's existing wrapping. Confidence: low (nit).
  • small_form_menu and big_form_menu duplicate the setup of small_menu and big_menu. The small_menu_with helper covers the small case, but the big variant is still a copy. This is acceptable. Confidence: low.
  • In the ESRI: link logic in crs_details, the epsg.io fallback to ?q=ESRI:<n> when the number is also an EPSG code is sensible. The URL format is unverified and I couldn't check it offline. Confidence: low.

AGENTS.md

  • Wasm: the new code is pure Rust and uses no std::time. ✔
  • i18n: the new UI string "EPSG or ESRI code" is wrapped in tl!. Catalog entries aren't required. ✔
  • Assets/attribution: ATTRIBUTION.md has a row for the Esri / PROJ-derived table, with its Apache-2.0 and MIT sources. ✔
  • Tests and docs: there are regression tests at the data, map, and engine layers, and the docs are updated. ✔
  • Layering: the map crate reaches the table through rustgis_data::raster::crs, which respects the layer order. ✔
  • I didn't run cargo xtask ci, so I can't confirm fmt, clippy, or the tests.

Change size

Compared against: the whole PR against main (merge base f0983b7 to PR head 48b311e).

Metric Value
Files changed 17 (1 added, 16 modified, 0 removed, 0 renamed)
Size before 1.09 MB
Size after 1.48 MB
Total size change +401.9 KB
File Before After Change
crates/data/src/raster/esri.rs 0 B 390.7 KB +390.7 KB
crates/map/src/projection.rs 41.2 KB 46.3 KB +5.1 KB
crates/data/src/raster/crs.rs 14.8 KB 16.4 KB +1.5 KB
crates/ui-egui/src/widgets.rs 19.8 KB 21.1 KB +1.2 KB
crates/engine/src/tests.rs 485.8 KB 487.0 KB +1.2 KB
crates/ui-egui/src/dialogs.rs 59.9 KB 60.7 KB +821 B
crates/map/src/globe.rs 28.7 KB 29.2 KB +493 B
docs/user-guide/maps.md 17.6 KB 17.9 KB +332 B
ATTRIBUTION.md 2.9 KB 3.2 KB +313 B
crates/map/src/world.rs 9.2 KB 9.3 KB +177 B
docs/user-guide/workspace.md 5.2 KB 5.2 KB +25 B
crates/ui-egui/src/lib.rs 162.5 KB 162.5 KB +23 B
crates/ui-egui/src/ribbon.rs 170.1 KB 170.1 KB +23 B
crates/engine/src/cmd/navigate.rs 32.8 KB 32.8 KB +14 B
crates/data/src/raster/mod.rs 33.7 KB 33.7 KB +10 B
docs/comparison/index.md 15.0 KB 15.0 KB +9 B
docs/installation.md 14.1 KB 14.1 KB +8 B

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