-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SEDONA-522] Add ST_Union with array of Geometry as input #1294
Conversation
Introduction: Return the union of geometry A and B | ||
Introduction: | ||
|
||
Variant 1: Return the union of geometry A and B. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Can you also update the ST_H3toGeom and ST_S2toGeom doc to explain how this ST_Union works in conjunction with these functions?
-
What happens to polygons that could not be unioned (polygons that share no boundaries)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Sure.
- It returns a MultiPolygon with each set of boundaries. See here:
sedona/spark/common/src/test/scala/org/apache/sedona/sql/functionTestScala.scala
Lines 700 to 705 in ec6dfff
it("Passed ST_Union - array variant") { val polyDf = sparkSession.sql("select array(ST_GeomFromWKT('POLYGON ((-3 -3, 3 -3, 3 3, -3 3, -3 -3))'),ST_GeomFromWKT('POLYGON ((5 -3, 7 -3, 7 -1, 5 -1, 5 -3))'), ST_GeomFromWKT('POLYGON((4 4, 4 6, 6 6, 6 4, 4 4))')) as polys") val actual = polyDf.selectExpr("ST_Union(polys)").take(1)(0).get(0).asInstanceOf[Geometry].toText val expected = "MULTIPOLYGON (((5 -3, 5 -1, 7 -1, 7 -3, 5 -3)), ((-3 -3, -3 3, 3 3, 3 -3, -3 -3)), ((4 4, 4 6, 6 6, 6 4, 4 4)))" assert(expected.equals(actual)) }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@furqaankhan Cool. Can you also explain this in the doc?
Introduction: Return the union of geometry A and B | ||
Introduction: | ||
|
||
Variant 1: Return the union of geometry A and B. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@furqaankhan Cool. Can you also explain this in the doc?
Did you read the Contributor Guide?
Is this PR related to a JIRA ticket?
[SEDONA-XXX] my subject
.What changes were proposed in this PR?
How was this patch tested?
Did this PR include necessary documentation updates?