Skip to content

Modernize proj4 CRS, axis, and datum-grid support - #102

Open
ibgreen-openai wants to merge 3 commits into
masterfrom
codex/proj4-modernization
Open

Modernize proj4 CRS, axis, and datum-grid support#102
ibgreen-openai wants to merge 3 commits into
masterfrom
codex/proj4-modernization

Conversation

@ibgreen-openai

@ibgreen-openai ibgreen-openai commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Goals

  • Modernize @math.gl/proj4 so current CRS definitions and datum transformations can support high-precision geospatial visualization workflows.
  • Preserve the existing bound, unary projection API while exposing modern axis-order and grid-registration capabilities.

Changes

  • Upgrade proj4 from 2.6.2 to 2.20.9, update wkt-parser, and remove obsolete @types/proj4 because upstream now ships its own declarations.
  • Accept WKT2 and PROJJSON CRS definitions, including PROJJSON aliases; export structural projection-definition and options types that do not leak optional upstream geotiff declarations.
  • Expose automatic WGS84 UTM definitions (EPSG:3260132660, EPSG:3270132760) and UPS definitions (EPSG:5041, EPSG:5042) without manual registration.
  • Add constructor-level enforceAxis support and Proj4Projection.registerDatumGrid(...) for synchronous NTv2 datum-grid registration.
  • Document modern CRS formats, axis order, and datum-grid usage.
  • Add coverage for WKT2, PROJJSON, UTM, UPS/polar stereographic, standalone bound callbacks, and a synthetic NTv2 grid without external binary fixtures.
  • Update inherited Hotine Oblique Mercator fixtures to the correct Azimuth Center variant and explicitly request +approx for spherical Transverse Mercator, matching modern proj4 semantics.

Verification

  • yarn build — all monorepo packages and generated declarations pass.
  • yarn test node2,746 / 2,746 assertions pass.
  • Focused @math.gl/proj4 suite — 270 / 270 assertions pass.
  • yarn test ci2,749 / 2,749 headless-browser assertions and 2,746 / 2,746 coverage-enabled Node assertions pass.
  • yarn lint — repository formatting and lint checks pass.
  • (cd website && yarn build) — production documentation website builds successfully.
  • A strict downstream TypeScript consumer compiles published declarations with skipLibCheck: false and without geotiff installed.
  • tspc --noEmit --project modules/proj4/tsconfig.json passes.

Compatibility notes

  • project and unproject remain bound unary methods, so existing Array.map(projection.project) usage continues to work.
  • Modern proj4 distinguishes center-based and natural-origin Hotine variants; fixture definitions now explicitly identify the variant matching EPSG:2057.
  • GeoTIFF datum grids remain an optional upstream capability; this wrapper exposes synchronous NTv2 ArrayBuffer registration without introducing a geotiff dependency.

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