Repository navigation
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] The PR appears safe to merge; no actionable defects were established. Summary
Review covered the full PR because the previous and current revisions have different merge bases. No actionable issues were established. Tests were not run.
|
9329c2a to
a8491df
Compare
|
Projection-engine injection is now implemented in #11112, stacked on this PR. It preserves prepared |
athomct
left a comment
There was a problem hiding this comment.
Thank you. This is a clean way to keep the selected converter without a proj4js dependency in deck.gl. The tests cover passthrough, a backend change and unkeyed descriptors. The focused specs pass for me (45 tests). I have two documentation points.
- Unkeyed descriptors now key by object identity. math.gl's default engine does not set
executionIdentity(I checked@math.gl/[email protected]). So a standaloneCustomProjectionViewportuser who spreads or rebuilds the descriptor on each frame gets a newprojectionSignatureon each frame. Then layers preproject again on each frame. Your fixture change intest-crs.tsshows the same effect. Please add one line towhats-new.mdor the upgrade guide. It can tell users to reuse one descriptor object or to setexecutionIdentity. crs.signatureno longer identifies the execution. Two prepared descriptors can share a signature and use different converters, as in your new test. A layer that caches CPU-converted positions bycrs.signaturedoes not see the backend change. I did not run this case. A short note in theCustomProjectionViewdocs can tell layer authors to key such caches onviewport.projectionSignature.
Small item: one sentence in the docs says "deck". The other docs say "deck.gl".
| The view resolves its CRS descriptor asynchronously using `projectionEngine.getCRS(crs)`. Deck waits for the descriptor before creating its viewport and controller. Resolution errors reach Deck's `onError` callback. For standalone viewport creation, see [CustomProjectionViewport](./custom-projection-viewport.md#usage). | ||
| For a CRS definition, the view resolves its descriptor asynchronously using `projectionEngine.getCRS(crs)`. Deck waits for the descriptor before creating its viewport and controller. Resolution errors reach Deck's `onError` callback. For standalone viewport creation, see [CustomProjectionViewport](./custom-projection-viewport.md#usage). | ||
|
|
||
| Pass a prepared math.gl `CRSDescriptor` as `crs` to use an application-supplied converter, such as proj4js. The descriptor must describe a projected CRS with linear axes and a WGS84 converter. Deck uses the descriptor directly, including its rendering bounds. Treat descriptors as immutable and provide an execution identity that distinguishes backend, version, operation, and relevant resources. Without an identity, deck only reuses the same descriptor object. |
There was a problem hiding this comment.
Suggest one more sentence: "Layers that cache CPU-converted positions should key them on viewport.projectionSignature, not on crs.signature." Also "deck" -> "deck.gl".
| this.isGeospatial = true; | ||
| this.signature = JSON.stringify([crs.signature, this.resolution]); | ||
| this.sizeScaleSignature = JSON.stringify([crs.signature, crs.renderingBounds]); | ||
| const executionKey = getProjectionExecutionKey(crs); |
There was a problem hiding this comment.
This changes the behavior for unkeyed descriptors that an app makes again on each frame. They now get a new signature on each frame. Please mention it in whats-new.md.
|
This is a reminder about my review of 16 November. The two documentation threads above have no answer yet:
The PR now has merge conflicts with |
For visgl/math.gl#525
Background
Centered Oblique Mercator in math.gl runs one PROJ definition through either math.gl or proj4js. Passing that definition to
_CustomProjectionViewasks deck.gl to resolve it with its own engine, losing the selected converter and local rendering bounds. Accepting a preparedCRSDescriptorpreserves that backend comparison without adding a proj4js dependency to deck.gl.Explicit execution identities distinguish converters for the same CRS definition. Descriptors without execution metadata use object identity, so unrelated callbacks cannot share cached projection results. Callers keep descriptors immutable and provide a new execution identity when execution changes; camera navigation can reuse the same descriptor.
Change List
CustomProjectionViewVerification: the full package build, lint, and 83 focused Chromium tests passed after rebasing onto current master, including all four original CI failures. The fixture-fix commit also passed 123 pre-commit Node tests; all latest CI jobs passed, including WebGPU, coverage, website, Python, and the projection-domains example.
The companion math.gl draft records Fiji parity with an unpublished build: for each backend, all 3,281 orange boundary pixels matched within two pixels in both directions, and viewport coordinates agreed within 3.3e-10 meters after unit conversion. That draft remains blocked on an upstream release containing this API and a clean-install recheck.
Note
Low Risk
Changes are confined to the experimental custom projection view and viewport system without impacting standard map projections.
Overview
Adds support for passing prepared math.gl
CRSDescriptorobjects directly toCustomProjectionViewalongside existing CRS definitions. When a prepared descriptor is provided, view initialization completes synchronously without invoking external CRS resolution.To handle caching and view equality across different converter backends (such as proj4js vs. math.gl),
CustomProjectionView,CustomProjectionViewport, and layer preprojection now identify projections using descriptor execution keys and rendering bounds, falling back to object identity when no execution identity is defined.Reviewed by Cursor Bugbot for commit a8491df. Bugbot is set up for automated code reviews on this repo. Configure here.