jiayuasu opened a new issue, #2928:
URL: https://github.com/apache/sedona/issues/2928

   Follow-up to the Phase 1 Box2D epic (#2877).
   
   ## Scope
   
   Add `Box3D` as a separate value type alongside `Box2D`, mirroring PostGIS's 
`box3d`. Phase 1 deliberately split the types rather than unifying via optional 
Z fields (rationale captured in #2877 — storage cost on `ST_Extent`, GeoParquet 
1.1 covering being 2D-only, static dispatch on `ST_Area` vs `ST_Volume`). When 
a concrete user lands (point clouds, BIM, voxel data), this issue tracks the 3D 
variant.
   
   ## Type
   
   `Box3DUDT` is a struct-backed UDT with `sqlType = struct<xmin, ymin, zmin, 
xmax, ymax, zmax: double>` (all non-nullable). Same NULL-for-absent semantics 
as `Box2D`. `xmin > xmax` ordering remains reserved for future antimeridian 
semantics on geography 3D bboxes.
   
   ## SQL surface
   
   | Function | Signature | PostGIS counterpart |
   |---|---|---|
   | `ST_Box3D(geom)` | Geometry → Box3D | `Box3D(geometry)` |
   | `ST_3DMakeBox(p1, p2)` | (Point, Point) → Box3D | `ST_3DMakeBox` |
   | `ST_3DExtent(geom)` | aggregate Geometry → Box3D | `ST_3DExtent` |
   | `ST_ZMin / ZMax(box3d)` | Box3D → Double | accessor overloads |
   | `ST_XMin / XMax / YMin / YMax(box3d)` | Box3D → Double | accessor 
overloads |
   | `ST_GeomFromBox3D(box)` | Box3D → Polygon Z | inverse cast |
   | `ST_AsText(box3d)` | Box3D → 'BOX3D(x1 y1 z1, x2 y2 z2)' | text serializer 
|
   
   ## Cross-language
   
   Mirror to Python and Flink, same as the Phase 1 Box2D pattern (#2887, #2888).
   
   ## Out of scope
   
   - 4D / M-bounded boxes — not in PostGIS; skip until a real need.
   - 3D GeoParquet covering. The GeoParquet 1.1 covering spec supports 
`zmin`/`zmax` optionally; if/when a 3D covering writer ships, add Box3D 
awareness then. Tracked separately if that becomes a priority.
   
   ## Dependencies
   
   Foundation in #2878 is reusable as a template. The Phase 1 type 
infrastructure (UDT, Python type, Flink TypeSerializer, InferredExpression 
mappings) gives a clear path.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to