Skip to content

feat(core): Support PROJJSON in coordinateSystem prop - #10894

Merged
Pessimistress merged 3 commits into
masterfrom
x/coordinate-system-projjson
Oct 23, 2026
Merged

Pessimistress merged 3 commits into
masterfrom
x/coordinate-system-projjson

Conversation

@Pessimistress

Copy link
Copy Markdown
Collaborator

For #10739

Change List

  • Expand coordinateSystem to accept PROJJSON and other math.gl CRS definitions.
  • Centralize CRS equality so equivalent objects preserve geometry; changed definitions trigger projectionChanged.
  • Refactor Layer.projectPosition to use resolved descriptors, eliminating per-vertex CRS resolution.
  • Update aggregation, lighting, masking, path styling, fp64, and bounds handling to use resolved or packed CRS.
  • Add regression coverage for structured CRS, tessellator invalidation, dash metrics, and projection behavior.
  • Update API documentation.

@Pessimistress
Pessimistress requested a review from ibgreen October 22, 2026 20:45
@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with a non-blocking correction needed in the migration table.

Findings

  1. P2 Migration table misses API differences ▶

Summary

Adds structured CRS support and shares resolved descriptors across projection, geometry, aggregation, and extensions.

  • Layers can describe their positions with structured coordinate reference systems.
  • Layers and extensions use resolved CRS details for their dependent calculations.
  • Mask bounds align with the coordinate space used by the receiving layer.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Layer coordinateSystem] --> B[Resolve CRS]
  B --> C[Compare definitions]
  C --> D[Preserve or rebuild geometry]
  B --> E[CPU projection]
  B --> F[Shader projection]
  D --> F
Loading

Reviews (3) · Last reviewed commit: "update upgrade guide" · Reviewed by Greptile

Comment thread modules/core/src/lib/layer-manager.ts Resolved
Comment thread modules/core/src/passes/layers-pass.ts Resolved
@coveralls

coveralls commented Oct 22, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 84.148% (+0.02%) from 84.132% — x/coordinate-system-projjson into master

@Pessimistress

Copy link
Copy Markdown
Collaborator Author

@kylebarron

@ibgreen ibgreen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. One softer API design suggestion for a follow-up: consider keeping coordinateSystem as a finite enum and adding a crs prop plus a 'crs' mode. If coordinateSystem is omitted or 'default' and crs is supplied, resolve the effective mode to 'crs'; explicit local modes would keep their current behavior. This keeps mode selection type-safe while allowing PROJJSON and other math.gl CRS inputs. It would be useful to define whether supplying crs alongside an explicit non-default mode is ignored or rejected. This could be a separate follow-up if it would expand this PR too much.

Comment thread modules/core/src/lib/layer.ts Resolved
Comment thread docs/upgrade-guide.md Resolved
@Pessimistress
Pessimistress merged commit 35ac0ff into master Oct 23, 2026
8 checks passed
@Pessimistress
Pessimistress deleted the x/coordinate-system-projjson branch October 23, 2026 20:36
@chrisgervang chrisgervang mentioned this pull request Oct 26, 2026
53 of 66 tasks
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.

3 participants