Skip to content

feat(proposals): support spatial SQL geometry accessors - #11278

Merged
ibgreen merged 5 commits into
masterfrom
codex/geoarrow-sql-accessors
Nov 22, 2026
Merged

ibgreen merged 5 commits into
masterfrom
codex/geoarrow-sql-accessors

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #11277

Change List

  • Preserve Arrow field metadata on SQL accessor results
  • Render SQL geometry accessors in GeoArrowLayer
  • Add an interactive spatial SQL example
  • Unit tests for centroid, interior point, and envelope
  • Render and picking tests on WebGL and WebGPU
  • Documentation

Verified 19 Node tests and two Chromium backend cases.


Note

Low Risk
Low risk. Changes primarily expand experimental proposal layers and preserve metadata on SQL accessor results without impacting existing core rendering pathways.

Overview
Adds support for evaluating SQL expressions in GeoArrowLayer's getGeometry prop, enabling rendering of derived geometries (such as ST_Centroid, ST_PointOnSurface, or ST_Envelope) while maintaining source-row picking and styling.

Arrow accessor query evaluation now preserves field extension metadata across column expressions and batch results. Layer introduces hasAccessorQuery and getAccessorQueryTable helpers so layers can access computed query columns, and GeoArrowLayer integrates computed geometry tables with source attributes for native rendering and GeoJSON fallbacks. An interactive example, documentation, and test coverage across WebGL and WebGPU are also included.

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

@coveralls

coveralls commented Nov 22, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.662% (+0.02%) from 82.638% — codex/geoarrow-sql-accessors into master

Base automatically changed from codex/geoarrow-url-input to master November 22, 2026 14:29
@ibgreen
ibgreen force-pushed the codex/geoarrow-sql-accessors branch from a09210b to 5fd3a6b Compare November 22, 2026 14:32
@ibgreen
ibgreen marked this pull request as ready for review November 22, 2026 14:34

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T14:36:52.106973Z 5fd3a6b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibgreen
ibgreen enabled auto-merge November 22, 2026 14:35

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5fd3a6b04b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@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 5fd3a6b. Configure here.

@ibgreen
ibgreen added this pull request to the merge queue Nov 22, 2026
@ibgreen
ibgreen removed this pull request from the merge queue due to a manual request Nov 22, 2026

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@ibgreen
ibgreen force-pushed the codex/geoarrow-sql-accessors branch from cc5defc to 2f58bdf Compare November 22, 2026 17:58

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@ibgreen
ibgreen merged commit 050030e into master Nov 22, 2026
11 of 12 checks passed
@ibgreen
ibgreen deleted the codex/geoarrow-sql-accessors branch November 22, 2026 18:12

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

Reviewed 2f58bdf after merge; follow-ups below.

No P1s.

Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.


Generated by Claude Code

Comment on lines +757 to +762
protected hasAccessorQuery(name: string): boolean {
return Boolean(this.props[ACCESSOR_QUERIES_SYMBOL]?.[name]);
}

/** Returns the current row-aligned SQL accessor results with their Arrow field metadata. */
protected getAccessorQueryTable() {

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.

P2: These add two protected methods to Layer in @deck.gl/core without an underscore. Only the private proposals layer uses them, but every Layer subclass sees them in the published types, so a later rename breaks subclasses.

  • The nearby experimental SQL helper is _getResolvedColorScales (layer.ts:772).
  • core/layer.md documents neither method.

Could we follow up by renaming them _hasAccessorQuery and _getAccessorQueryTable?


Generated by Claude Code

Comment on lines +130 to +133
const geometry = resolveGeoArrowGeometry(
geometryData,
computedGeometry?.name ?? columnName,
props.geometryType

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.

Non-blocking: geometryType also overrides the SQL result's encoding. With geometryType: 'geoarrow.polygon' and ST_Centroid, the WKB result goes to the native polygon renderer (resolve-geoarrow-geometry.ts:46).

Could geometryType apply only to the source column?


Generated by Claude Code

Comment on lines 45 to +46
/** Geometry column. Defaults to the declared primary geometry or first GeoArrow field. */
getGeometry?: string;
getGeometry?: string | {readonly sql: string};

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.

Non-blocking: The TSDoc still describes only a column name.

Suggested change
/** Geometry column. Defaults to the declared primary geometry or first GeoArrow field. */
getGeometry?: string;
getGeometry?: string | {readonly sql: string};
/** Geometry column, or a SQL accessor such as `{sql: 'ST_Centroid(geometry)'}`. Defaults to the declared primary geometry or first GeoArrow field. */
getGeometry?: string | {readonly sql: string};

Generated by Claude Code

@@ -0,0 +1,6 @@
# GeoArrow spatial SQL

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.

Non-blocking: (Outside the diff: examples-v10/proposals/README.md:38) The Examples list there does not include geoarrow-sql. This line is fine.

Could we add - [geoarrow-sql](./geoarrow-sql/) to that list?


Generated by Claude Code

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