Skip to content

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

Merged
Pessimistress merged 14 commits into
masterfrom
x/alt-proj-aggregation-plumbing
Oct 8, 2026
Merged

Pessimistress merged 14 commits into
masterfrom
x/alt-proj-aggregation-plumbing

Conversation

@Pessimistress

@Pessimistress Pessimistress commented Sep 24, 2026 •

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.

Note

Medium Risk
Touches CPU/GPU binning, bounds, and projection uniforms across all major aggregation layers; regressions would show as misaligned bins or heatmaps on custom projections and some transform/modelMatrix cases.

Overview
Adds common-space aggregation for experimental custom projection views so Contour, Grid, Hexagon, Heatmap, and ScreenGrid bin and render using preprojected map-meter positions, matching equivalent Cartesian data on CPU and GPU.

AggregationLayer gains shared projection helpers (projectPositionFromAttribute, bounds handling for Cartesian transforms, GPU project uniform overrides) and a dedicated createAggregationViewport for stable GPU binning. Per-layer updates wire position attribute transforms, anchor bin sizes with getDistanceScales at data-center, fix heatmap/screen-grid bounds and texture math under preproject, and adjust contour sublayer matrices for custom geospatial projection.

Core/API: CustomProjectionViewport.getDistanceScales(coordinateOrigin?) evaluates ground-meter scales at a fixed map-meter anchor; Layer.projectPosition accepts overrides including modelMatrix: null; docs and release notes describe approximated ground meters for cellSize/radius and list aggregation layers as supported.

Tests: large vitest suite for parity across backends/transforms/panning, deterministic projectionGrid fixture, and conic-projection render goldens for contour/hexagon/heatmap.

Reviewed by Cursor Bugbot for commit e99db77. Bugbot is set up for automated code reviews on this repo. Configure here.

@coveralls

coveralls commented Sep 24, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 83.419% (+0.2%) from 83.221% — x/alt-proj-aggregation-plumbing into master

@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium impact] Adds custom projection support to aggregation layers.

The PR does not appear safe to merge until bin sizing remains stable for Cartesian data whose center cannot be inverse-projected.

Findings

  1. P1 Camera-dependent fallback changes bins ▶

Summary

The PR moves aggregation under custom projections into common space and adds parity and render coverage.

  • Preprojects positions for Contour, Grid, Hexagon, Heatmap, and ScreenGrid.
  • Aligns CPU/GPU binning, bounds, and contour sublayers with common-space coordinates.
  • Adds data-anchored distance-scale lookup, documentation, fixtures, and tests.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Geo["Geographic positions"] --> Pre["Preproject to map meters"]
  Cartesian["Cartesian positions"] --> Bounds["Data bounds and local scales"]
  Pre --> Bounds
  Bounds --> Bins["Common-space CPU/GPU bins"]
  Bins --> Output["Aggregation sublayers"]
Loading

Reviews (10) · Last reviewed commit: "address comments" · Reviewed by Greptile

@Pessimistress
Pessimistress force-pushed the x/alt-proj-aggregation-plumbing branch from b325aa0 to d185f05 Compare September 24, 2026 21:44
@Pessimistress
Pessimistress force-pushed the x/alt-proj-aggregation-plumbing branch from d185f05 to 8aff8a2 Compare September 25, 2026 03:02
@Pessimistress
Pessimistress force-pushed the x/alt-proj-aggregation-plumbing branch from 8aff8a2 to fe708cb Compare September 25, 2026 04:16
@Pessimistress
Pessimistress force-pushed the x/alt-proj-aggregation-plumbing branch from fe708cb to 2975da2 Compare September 27, 2026 21:08
@Pessimistress
Pessimistress force-pushed the x/alt-proj-aggregation-plumbing branch from 758fa0b to 996e5f4 Compare September 29, 2026 00:34
@Pessimistress
Pessimistress force-pushed the x/alt-proj-aggregation-plumbing branch from 996e5f4 to 900472b Compare October 6, 2026 18:52

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@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.

Thanks Xiaoji, this is a useful step toward supporting non-Web-Mercator datasets throughout deck.gl. Aggregating in the projected plane and keeping generated geometry in that space is the right direction.

Approving the overall direction, with two remaining correctness issues recorded inline: preserving Cartesian layer transforms and making meter-sized bin definitions independent of the camera center. Please address these as this stack progresses.

For the API, please document whether cellSize/radius represent map meters or locally approximated ground meters, and where that approximation is evaluated. Reusable projection-scale calculations could naturally live in math.gl; aggregation lifecycle, GPU precision viewports, and sublayer construction belong in deck.gl.

Reviewed statically at 900472b; tests were not run.

Base automatically changed from x/alt-proj-layer-plumbing to master October 7, 2026 22:44
@Pessimistress
Pessimistress force-pushed the x/alt-proj-aggregation-plumbing branch from 900472b to 03e6c48 Compare October 8, 2026 18:07

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0831dfe. Configure here.

@Pessimistress
Pessimistress merged commit 8274410 into master Oct 8, 2026
8 checks passed
@Pessimistress
Pessimistress deleted the x/alt-proj-aggregation-plumbing branch October 8, 2026 19:13
@chrisgervang chrisgervang mentioned this pull request Oct 22, 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