jiayuasu opened a new pull request, #2897: URL: https://github.com/apache/sedona/pull/2897
## Did you read the Contributor Guide? - Yes, I have read the [Contributor Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/latest/community/develop/) ## Is this PR related to a ticket? - Yes, and the PR name follows the format \`[GH-XXX] my subject\`. Closes #2883 ## What changes were proposed in this PR? Adds the \`ST_MakeBox2D(lower_left: Point, upper_right: Point) -> Box2D\` scalar constructor. PostGIS-compatible. \`\`\`sql SELECT ST_MakeBox2D(ST_Point(1.0, 2.0), ST_Point(4.0, 5.0)); -- BOX(1.0 2.0, 4.0 5.0) \`\`\` Behavior: - Coordinates are taken **verbatim** — no swapping or ordering validation. \`xmin > xmax\` / \`ymin > ymax\` are preserved as supplied. This is deliberate: it leaves those orderings reserved for a future antimeridian-wraparound semantics on the longitude axis (cf. \`apache/sedona-db\`'s \`WraparoundInterval\`). - NULL or empty point inputs return NULL. - Non-point inputs raise \`IllegalArgumentException(\"ST_MakeBox2D requires two POINT geometries\")\`. ## How was this patch tested? \`constructorTestScala\`: - \"Passed ST_MakeBox2D\" — happy path, NULL right-hand input → NULL, empty left-hand input → NULL. - \"ST_MakeBox2D preserves swapped corners\" — \`ST_MakeBox2D(ST_Point(170,10), ST_Point(-170,20))\` round-trips with \`xmin=170, xmax=-170\` (no auto-swap). - \"ST_MakeBox2D rejects non-point input\" — LINESTRING raises with the documented message. ## Did this PR include necessary documentation updates? - No, this PR does not affect any public SQL API documentation surface in isolation. Documentation for \`ST_MakeBox2D\` lands with the rest of the Phase 1 surface (#2877) once \`ST_Extent\`, the cast/text functions, and bindings exist. Scala DataFrame API wrappers tracked separately in #2891. -- 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]
