Skip to content

feat(layers): aggregate custom projections in common space - #10743

Open
Pessimistress wants to merge 3 commits into
x/alt-proj-layer-plumbingfrom
x/alt-proj-aggregation-plumbing
Open

Pessimistress wants to merge 3 commits into
x/alt-proj-layer-plumbingfrom
x/alt-proj-aggregation-plumbing

Conversation

@Pessimistress

Copy link
Copy Markdown
Collaborator

For #10739 (PR 4 of 6)

Make aggregation layers operate on preprojected positions in custom projection views.

Changed list

  • Update Contour, Grid, Hexagon, Heatmap, and ScreenGrid position handling.
  • Align aggregation results and sublayers with common-space coordinates.
  • Test aggregation against equivalent Cartesian data.
  • Add deterministic geographic grid fixtures.
  • Add conic-projection render coverage for Contour, Heatmap, and Hexagon.

@coveralls

coveralls commented Sep 24, 2026 •

Copy link
Copy Markdown

Coverage Status

Coverage is 82.965% — x/alt-proj-aggregation-plumbing into x/alt-proj-layer-plumbing. No base build found for x/alt-proj-layer-plumbing.

@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

The PR is not ready to merge while custom contour sublayer overrides can still reproject vertices and the required user-facing support note is absent.

Findings

  1. P1 Custom contour sublayers reproject vertices ▶
  2. P2 Matrix allocation per contour vertex ▶
  3. P2 New support lacks release note ▶
  4. P2 Projected screen bins lack coverage ▶

Summary

This PR makes aggregation layers consume preprojected positions in common space and adds Cartesian-comparison tests and conic-projection render coverage.

  • Updates position handling for Contour, Grid, Hexagon, Heatmap, and ScreenGrid.
  • Adds deterministic grid fixtures and render baselines.

Reviews (2) · Last reviewed commit: "test: migrate aggregation fixtures to CR..."

Comment on lines +365 to +372
const preprojected = Boolean(this.context.viewport.preproject);
const LinesSubLayerClass = this.getSubLayerClass(
'lines',
preprojected ? ContourPathLayer : PathLayer
);
const BandsSubLayerClass = this.getSubLayerClass(
'bands',
preprojected ? ContourPolygonLayer : SolidPolygonLayer

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Custom contour sublayers reproject vertices If an application supplies _subLayerProps.lines.type or _subLayerProps.bands.type using a regular PathLayer or SolidPolygonLayer subclass, that type replaces the projection-aware class selected here. Its tessellator then preprojects contour vertices that are already in common-space bin coordinates, shifting or hiding the contours. Custom sublayer types need to retain the bin-to-common transform.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +12 to +16
function transformContourPosition(this: Layer, position: number[]): number[] {
const result = position.slice();
if (this.props.modelMatrix) {
new Matrix4(this.props.modelMatrix).transformAsPoint(position, result);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Matrix allocation per contour vertex Tessellation calls this transform for each generated vertex, but every vertex in a sublayer uses the same bin-to-common matrix. Constructing a new Matrix4 each time adds avoidable allocations, especially for dense contours. Reuse the matrix or transform with its existing values.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +120 to +124
`test/render/test-cases/custom-projection.spec.ts` also renders an Albers
equal-area conic grid spanning [-135, 30, -45, 75]. Its 4,186 deterministic points
form two smooth weight peaks. Contour isolines/isobands and flat, top-down
hexagons compare CPU and GPU aggregation against shared baselines; HeatmapLayer
checks the projected weight texture against the same geographic boundary.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 New support lacks release note This audit describes the added custom-projection aggregation support, but docs/whats-new.md still lists only the initial scatterplot, path, and polygon support. The repository requires newly added support to be documented in docs/whats-new.md, rather than only in an internal audit. Add that user-facing note before merging.

Rule Used: In the deck.gl repository, use Remarks sections only for user-facing, actionable limitations; document newly added support in docs/whats-new.md instead. (source)

Comment on lines +187 to +188
fp64: this.use64bitPositions(),
...this.usePositionTransforms()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Projected screen bins lack coverage ScreenGrid now transforms positions before CPU and GPU screen binning, but the new ScreenGrid test checks only the resulting position attribute. Neither the bin-comparison tests nor the conic render cases exercise its projected screen bins. Add a CPU/GPU bin or render comparison so a mismatch between the two screen-coordinate paths can be detected.

@Pessimistress
Pessimistress added this pull request to stack #10746 September 24, 2026 15:59
@Pessimistress
Pessimistress force-pushed the x/alt-proj-aggregation-plumbing branch from b325aa0 to d185f05 Compare September 24, 2026 21:44

This branch has not been deployed

No deployments
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.

2 participants