-
Notifications
You must be signed in to change notification settings - Fork 655
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-498] Add Spheroidal ST_Buffer #1251
Conversation
# Conflicts: # common/src/main/java/org/apache/sedona/common/Functions.java # common/src/test/java/org/apache/sedona/common/FunctionsTest.java # python/tests/sql/test_function.py
# Conflicts: # common/src/test/java/org/apache/sedona/common/FunctionsTest.java # python/tests/sql/test_function.py # spark/common/src/test/scala/org/apache/sedona/sql/functionTestScala.scala
# Conflicts: # common/src/main/java/org/apache/sedona/common/Functions.java # common/src/main/java/org/apache/sedona/common/Predicates.java
min = Math.min(points[i].getX(), min); | ||
} | ||
return min; | ||
} | ||
|
||
public static double xMax(Geometry geometry) { | ||
public static double xMax (Geometry geometry){ |
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.
Why does this PR fix the format of every single function of this file?
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.
My IDE (IntelliJ) automatically reformatted the code style when resolving merge conflicts. Should I rollback these format changes?
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.
@prantogg I would prefer that if you can roll back the format changes.
docs/api/flink/Function.md
Outdated
@@ -571,10 +590,13 @@ Format: | |||
``` | |||
ST_Buffer (A: Geometry, buffer: Double, bufferStyleParameters: String [Optional]) | |||
``` | |||
``` | |||
ST_Buffer (A: Geometry, buffer: Double, bufferStyleParameters: String [Optional], useSperoidal: Boolean) |
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.
UseSpheroid
parameter should be the 3rd param.
val polygonDf = sparkSession.sql("select ST_GeomFromWKT(polygontable._c0) as countyshape from polygontable") | ||
polygonDf.createOrReplaceTempView("polygondf") | ||
val functionDf = sparkSession.sql("select ST_Buffer(polygondf.countyshape, 1, true) from polygondf") | ||
assert(functionDf.count() > 0); |
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.
Please add a test that uses ST_Buffer with all 4 params
min = Math.min(points[i].getX(), min); | ||
} | ||
return min; | ||
} | ||
|
||
public static double xMax(Geometry geometry) { | ||
public static double xMax (Geometry geometry){ |
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.
@prantogg I would prefer that if you can roll back the format changes.
The optional third parameter, `useSpheroid`, controls the mode of buffer calculation. | ||
|
||
- Planar Buffering (default): When `useSpheroid` is false, `ST_Buffer` performs standard planar buffering based on the provided parameters. | ||
- Spheroidal Buffering: |
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.
One last thing. Please add that, when useSpheroid
is set to true, the unit of the buffer is meter
.
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.
Done
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?
Adds Spheroidal support for
ST_Buffer
. Functions as follows,ST_BestSRID
to determine the optimal SRID based on the geometry's extent and location.ST_ShiftLongitude
on geometries crossing the IDL.ST_CrossesDateLine
is used to determine if geometry crosses the IDL.ST_Buffer(Geography)
.Updates ST_BestSRID as follows,
ST_ShiftLongitude
on geometries crossing the IDL determined byST_CrossesDateLine
How was this patch tested?
Did this PR include necessary documentation updates?
vX.Y.Z
format.