Repository navigation
Projections: draw the map in ESRI codes (#213) - #494
Conversation
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
|
Warning Review limit reachedYou'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. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Code reviewI read the whole diff apart from the generated Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base f0983b7 to PR head 0a12001).
|
📖 Docs preview
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.
Code reviewThis PR adds ESRI:
|
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.
Code reviewThis PR adds ESRI:
|
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.
Code reviewI read the whole PR except the generated ESRI table body, which I only sampled. I found no blocking problems. The PR adds ESRI:
|
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.
Code reviewI read the full diff apart from the 1,983-row generated table in Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared against: the whole PR against main (merge base f0983b7 to PR head 48b311e).
|
Point (d) of #213, by option 3 as agreed in the issue:
map.projectionnow takesESRI:<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.projectiononly took presets,EPSG:codes andlocal:lon,lat, soESRI:102033(South America Albers, the issue's example) failed withunknown projection 'ESRI:102033'.crs-definitionshas no ESRI authority.The fix
crates/data/src/raster/esri.rs: 1,983 ESRI projected systems, built likeepsg_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'sProjectorand by pyproj, and kept only when the two agree within 1 m.esri.rslists the reasons.epsg_gap.rsrule: 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.rsprojections now read+R, so ESRI'sSphere_*systems (6371 km spheres) match PROJ instead of using the WGS 84 radius.ESRI:102100andESRI:102113resolve to the default Web Mercator map. A code is saved asESRI:<n>.ESRI:…(a bare number is still an EPSG code), and the epsg.io link goes to the ESRI page.?projection=), comparison.Tests
rustgis-dataesri_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-mapesri_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_meridiannow covers the ESRI world systems too.rustgis-engineesri_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