Skip to content

Conversation

@Kontinuation
Copy link
Member

@Kontinuation Kontinuation commented Feb 24, 2025

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

This work is largely based on #1811.

This PR adds a GeographyUDT to match the GeometryUDT. This matches how the types are defined in Iceberg and Parquet, and maps to the concepts of "edges": "spherical" in GeoParquet and GeoArrow.

The newly added Geography type that backs GeographyUDT is a simple wrapper around JTS Geometry type. This is for illustrating the idea of how we support Geography types, and does not reflect how we'll actually implement Geography type and spherical computations.

We've also enhanced InferredExpression to support function overloading with same arity. For instance, we can have the following 2 overloads to support both Geometry and Geography:

  • ST_AsEWKB(geometry) -> binary
  • ST_AsEWKB(geography) -> binary

The rule for resolving overloaded function is pretty simple for now: it selects the function requiring minimal amount of type coercions. Please refer to FunctionResolver.resolveFunction for details.

How was this patch tested?

Added new tests.

Did this PR include necessary documentation updates?

The support for Geography type is not complete yet, so we don't bother updating the documentation for now.

@Kontinuation Kontinuation marked this pull request as ready for review February 24, 2025 13:31
@Kontinuation Kontinuation changed the title Add Geography user-defined type [SEDONA-711] Add Geography user-defined type Feb 24, 2025
@jiayuasu jiayuasu added this to the sedona-1.7.1 milestone Feb 24, 2025
@jiayuasu jiayuasu merged commit aede0eb into apache:master Feb 24, 2025
40 checks passed
Kontinuation added a commit to Kontinuation/sedona that referenced this pull request Jan 21, 2026
apache#389)

* start basic object

* compiling udt class

* maybe actually register

* add one input and one output function

* maybe one input and one output function

* maybe builds

* some possible Python requirements

* format

* maybe a few more references to geography

* remove word

* Making ST_GeogFromWKT, ST_AsEWKT, ST_AsEWKB work properly

* Add geography serde tests and dataframe api tests for python binding

---------

Co-authored-by: Dewey Dunnington <dewey@wherobots.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants