Skip to content

Lightweight CRS parser to remove hard pyproj dependency#1072

Merged
brendancol merged 9 commits into
masterfrom
issue-1057
Mar 24, 2026
Merged

Lightweight CRS parser to remove hard pyproj dependency#1072
brendancol merged 9 commits into
masterfrom
issue-1057

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Closes #1057

Summary

  • Adds a lightweight CRS class that covers the ~150 EPSG codes with Numba fast paths (WGS84, NAD83, NAD27, UTM zones, Web Mercator, Albers, LCC, LAEA, polar/oblique stereographic, CEA, ellipsoidal Mercator)
  • _resolve_crs() and _crs_from_wkt() try the built-in table first, fall back to pyproj for anything else
  • _grid.py boundary estimation and _source_footprint_in_target use a new transform_points() scatter-point helper that reuses existing Numba kernels, so pyproj.Transformer is only needed for unsupported CRS pairs
  • Chunk functions (_reproject_chunk_numpy, _reproject_chunk_cupy) and reproject()/merge() no longer call _require_pyproj() upfront -- pyproj is imported lazily only when the fast path can't handle the CRS

Test plan

  • 106 new tests in test_lite_crs.py covering construction, to_dict/to_wkt round-trips, pyproj comparison for all embedded codes, two-tier resolution, scatter-point transforms, grid computation with lite CRS, and monkeypatched no-pyproj integration tests
  • 1 new integration test in test_reproject.py for full reproject() with lite CRS
  • All 193 tests pass, including the existing 86 reproject regression tests

@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Mar 24, 2026
@brendancol brendancol merged commit 8117303 into master Mar 24, 2026
11 checks passed
@brendancol brendancol deleted the issue-1057 branch May 4, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lightweight CRS parser to remove hard pyproj dependency

1 participant