Skip to content

Commit 2f18a4c

Browse files
feat(vortex-geo): add native geoarrow.box bounding-box type (#8746)
## Rationale for this change Groundwork for spatial chunk-pruning: the upcoming geometry-bounds zone-map needs to store bounding boxes as a first-class geometry so the pruning rules can reuse the existing `ST_Distance` / `ST_Intersects` / `ST_Contains` kernels on them instead of hand-rolled box math. ## What changes are included in this PR? - New `Rect` extension type (`vortex.geo.box`, GeoArrow's `geoarrow.box`): an axis-aligned box stored as `Struct<xmin, ymin[, zmin][, mmin], xmax, ymax[, zmax][, mmax]>` of non-nullable `f64`. --------- Signed-off-by: Nemo Yu <zyu379@wisc.edu>
1 parent 0aa35f4 commit 2f18a4c

6 files changed

Lines changed: 572 additions & 3 deletions

File tree

vortex-geo/src/extension/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ mod multipoint;
88
mod multipolygon;
99
mod point;
1010
mod polygon;
11+
mod rect;
1112
mod wkb;
1213

1314
use std::fmt::Display;
@@ -37,6 +38,7 @@ pub use multipoint::*;
3738
pub use multipolygon::*;
3839
pub use point::*;
3940
pub use polygon::*;
41+
pub use rect::*;
4042
use vortex_array::ArrayRef;
4143
use vortex_array::ExecutionCtx;
4244
use vortex_array::IntoArray;
@@ -63,6 +65,7 @@ fn is_native_geometry(dtype: &DType) -> bool {
6365
|| ext.is::<Polygon>()
6466
|| ext.is::<MultiLineString>()
6567
|| ext.is::<MultiPolygon>()
68+
|| ext.is::<Rect>()
6669
})
6770
}
6871

@@ -110,6 +113,8 @@ pub(crate) fn geometries(
110113
multilinestring_geometries(&storage, ctx)
111114
} else if ext.is::<MultiPolygon>() {
112115
multipolygon_geometries(&storage, ctx)
116+
} else if ext.is::<Rect>() {
117+
rect_geometries(&storage, ctx)
113118
} else {
114119
vortex_bail!("geo: unsupported geometry extension {}", array.dtype())
115120
}

0 commit comments

Comments
 (0)