Skip to content

feat(vortex-geo): native Geometry extension type with point support#8376

Draft
HarukiMoriarty wants to merge 1 commit into
developfrom
nemo/geo-geometry
Draft

feat(vortex-geo): native Geometry extension type with point support#8376
HarukiMoriarty wants to merge 1 commit into
developfrom
nemo/geo-geometry

Conversation

@HarukiMoriarty

@HarukiMoriarty HarukiMoriarty commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Alternative approach to #8372. That PR gives each geometry kind its own extension type (vortex.geo.point, …); this PR uses a single type vortex.geo.geometry for all kinds, with the kind and the CRS carried in the extension metadata.

Spatial functions are signed distance(geometry, geometry), not per-kind: the operand check is one ext.is::<Geometry>(), kernels dispatch on kind at runtime, and a new kind is a metadata value plus a match arm — not a new type and new signatures. The kind lives in metadata because GeoArrow layouts collide (linestring ≡ multipoint, polygon ≡ multilinestring).

Like #8372, point is the first supported kind.

API Changes

Adds to vortex-geo, all registered through vortex_geo::initialize:

  • Extension type Geometry (vortex.geo.geometry).
  • GeoMetadata gains a geometry_type: GeometryKind field next to crs.
  • GeometryValue: the value a geometry scalar unpacks to; its Display emits WKT.
  • Scalar function GeoDistance (vortex.geo.distance): per-row distance with PostGIS ST_Distance semantics.

Testing

Unit tests cover dtype validation for every GeoArrow dimension (plus rejection of invalid storage, non-point kinds, and the Unspecified kind), metadata round-tripping with and without a kind, round-tripping a point column through scalar execution back to the original coordinates, WKT display for every kind including dimension tags and EMPTY, distance over all operand shapes (column-to-constant on either side, column-to-column, constant-to-constant), and construction-time rejection of non-geometry operands, mismatched CRS, and nullable columns.

Add a single logical extension type `vortex.geo.geometry` for GeoArrow-native
geometry. The geometry kind (point, linestring, ...) and the CRS live in the
extension metadata; the storage dtype is the kind's GeoArrow separated
coordinate layout, and the coordinate dimension is recovered from the storage
field names. Only point columns are supported end to end so far; other kinds
are rejected at dtype construction until their scalar unpacking and kernels
exist.

Add a `vortex.geo.distance` scalar function computing planar (Euclidean)
distance. The signature takes geometry operands and execution dispatches on
their kinds, with a point x point kernel; operands are type-checked at
construction to be non-nullable point columns sharing a CRS.

Signed-off-by: Nemo Yu <zyu379@wisc.edu>
@HarukiMoriarty HarukiMoriarty requested a review from a team June 11, 2026 20:54
@HarukiMoriarty HarukiMoriarty marked this pull request as draft June 11, 2026 20:54
@codspeed-hq

codspeed-hq Bot commented Jun 11, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 26.14%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 5 improved benchmarks
✅ 1531 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_bool_canonical_into[(1000, 10)] 35.5 µs 20.5 µs +72.69%
Simulation chunked_varbinview_canonical_into[(1000, 10)] 198.1 µs 162 µs +22.32%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 213.5 µs 177.4 µs +20.4%
Simulation bitwise_not_vortex_buffer_mut[128] 244.4 ns 215.3 ns +13.55%
Simulation bitwise_not_vortex_buffer_mut[1024] 304.7 ns 275.6 ns +10.58%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing nemo/geo-geometry (ee1e166) with develop (8acef3a)

Open in CodSpeed

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.

1 participant