Skip to content

Reject spatial functions over geometries with different CRSs - #11859

Open
HarukiMoriarty wants to merge 3 commits into
nemo/spatial-wkb-literal-crsfrom
nemo/spatial-crs-check
Open

HarukiMoriarty wants to merge 3 commits into
nemo/spatial-wkb-literal-crsfrom
nemo/spatial-crs-check

Conversation

@HarukiMoriarty

@HarukiMoriarty HarukiMoriarty commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #11872, which is stacked on #11865. Until #11872 merges, this diff also shows its envelope commit; review only the second commit.

vortex.st.distance, vortex.st.intersects and vortex.st.contains ignored the CRS of their operands, so two geometries in different CRSs (for example EPSG:4326 and EPSG:32633) were computed on together and returned meaningless results without an error. Each geometry kind is its own extension type, so these functions cannot require equal operand dtypes the way most scalar functions do; they now require equal CRSs instead, checked when the expression is typed. A missing CRS matches only another missing CRS. The check is ensure_eq_crs, which reads each operand's metadata through the AnyNativeGeometry matcher from #11872. Transforming between CRSs stays the query engine's job, as proposed in #11807.

Behaviour change: these functions now return an error for operands with different CRSs instead of a result, and vortex.st.make_line no longer accepts one operand with a CRS and one without.

🤖 Generated with Claude Code

Comment thread vortex-spatial/src/extension/mod.rs Resolved
Comment thread vortex-spatial/src/extension/mod.rs Resolved
Comment thread vortex-spatial/src/scalar_fn/row.rs Resolved
Comment thread vortex-spatial/src/extension/mod.rs Resolved
@codspeed

codspeed Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

2 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 2 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 2058 untouched benchmarks
⏩ 150 skipped benchmarks1


Comparing nemo/spatial-crs-check (de71e84) with nemo/spatial-wkb-literal-crs (58a0870)

Open in CodSpeed

Footnotes

  1. 150 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Signed-off-by: Nemo Yu <zyu379@wisc.edu>
Signed-off-by: Nemo Yu <zyu379@wisc.edu>
Signed-off-by: Nemo Yu <zyu379@wisc.edu>
@HarukiMoriarty
HarukiMoriarty enabled stacked auto-merge (squash) November 24, 2026 06:18

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

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants