Skip to content

[GH-3176] Add Geography support for convex hull and collection - #3198

Merged
jiayuasu merged 4 commits into
masterfrom
feature/geography-convex-hull
Jul 31, 2026
Merged

[GH-3176] Add Geography support for convex hull and collection#3198
jiayuasu merged 4 commits into
masterfrom
feature/geography-convex-hull

Conversation

@jiayuasu

@jiayuasu jiayuasu commented Jul 28, 2026

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

  • Add spherical Geography support for ST_ConvexHull, including geodesic edges, dimensionality preservation, antimeridian handling, exact source-coordinate preservation for hull vertices, and explicit full-sphere rejection.
  • Extend scalar ST_Collect and aggregate ST_Collect_Agg to preserve either the Geometry or Geography logical type.
  • Register the native Catalyst ST_Collect_Agg expression. Its DataFrame wrapper resolves the registered function by name and therefore requires SedonaContext registration.
  • Reject invalid ST_Collect calls during analysis: arrays with non-Geometry/Geography elements and calls with multiple array arguments now raise errors instead of silently returning empty or incorrect results.
  • Add the Geography overloads to both Spark and Flink, including Flink's ST_Collect_Aggr alias.
  • For supported inputs, preserve null handling, duplicates, SRIDs, empty values, and aggregate merge behavior.
  • Correct empty Geography LineString WKB serialization and normalize the legacy header-only representation.

How was this patch tested?

  • Common Geography and WKB tests: 111 passed.
  • Spark Geography and SRID suites: 80 passed.
  • Spark aggregate suite: 30 passed.
  • Spark DataFrame aggregate API test: 1 passed.
  • Flink Geography, aggregate, merge, and Geometry regression tests: 39 passed.
  • Spark 4.1 with Scala 2.13 compile: passed.
  • Spotless, pre-commit hooks, and git diff --check: passed.

Did this PR include necessary documentation updates?

  • Yes, I am adding new Geography APIs using the current SNAPSHOT version number, v1.9.1.
  • Yes, I updated the Spark SQL and Flink API pages and function indexes.

jiayuasu added 4 commits July 28, 2026 00:45
…onvex-hull

# Conflicts:
#	common/src/main/java/org/apache/sedona/common/S2Geography/WKBWriter.java
#	common/src/main/java/org/apache/sedona/common/geography/Functions.java
#	common/src/test/java/org/apache/sedona/common/Geography/FunctionTest.java
#	docs/api/flink/Geography-Functions.md
#	spark/common/src/test/scala/org/apache/sedona/sql/geography/GeographyFunctionTest.scala
#	spark/common/src/test/scala/org/apache/sedona/sql/geography/PreserveSRIDGeographySuite.scala
@jiayuasu
jiayuasu marked this pull request as ready for review July 31, 2026 09:17
@jiayuasu jiayuasu added this to the sedona-1.9.1 milestone Jul 31, 2026
@jiayuasu
jiayuasu merged commit f601f3c into master Jul 31, 2026
44 checks passed
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.

Add Geography support for ST_ConvexHull and the geometry-collecting aggregate

1 participant