Skip to content

Implement ST_MakeBox2D(p1, p2) scalar constructor #2883

@jiayuasu

Description

@jiayuasu

Sub-task of #2877.

Scope

Add the ST_MakeBox2D(lower_left: Point, upper_right: Point) -> Box2D scalar constructor. Direct PostGIS counterpart.

Returns a Box2D from two opposing corner points. NULL propagates from either input.

Implementation

  • New ST_MakeBox2D case class in spark/common/.../expressions/Constructors.scala.
  • Backing helper in common/.../Functions.java (or a new Box2DConstructors.java) that builds a Box2D from two Point instances.
  • Catalog registration.
  • Tests: ordered corners, swapped corners (xmin > xmax should remain — this is the antimeridian-reserved space, NOT empty; document the user contract), 3D point input, null propagation.

Out of scope

ST_3DMakeBox (waits for Box3D).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions