Skip to content
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-213] Add ST_BoundingDiagonal #863

Merged
merged 45 commits into from
Jun 23, 2023

Conversation

iGN5117
Copy link
Contributor

@iGN5117 iGN5117 commented Jun 20, 2023

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

  • Add ST_BoundingDiagonal to Sedona

How was this patch tested?

  • Comprehensive correctness test cases in java
  • Integration test cases in Spark and Flink

Did this PR include necessary documentation updates?

  • Yes, I am adding a new API. I am using the 1.5.0 in since vX.Y.Z format.

iGN5117 added 30 commits June 6, 2023 13:29
Removed note/tip block elements that caused numbering to be reset
Changed generic Exception to IllegalArgumentException in ST_NumPoints implementation and its corresponding test
# Conflicts:
#	common/src/main/java/org/apache/sedona/common/Functions.java
#	common/src/test/java/org/apache/sedona/common/FunctionsTest.java
#	flink/src/main/java/org/apache/sedona/flink/Catalog.java
#	flink/src/main/java/org/apache/sedona/flink/expressions/Functions.java
#	flink/src/test/java/org/apache/sedona/flink/FunctionTest.java
#	python/sedona/sql/st_functions.py
#	python/tests/sql/test_function.py
#	sql/common/src/main/scala/org/apache/sedona/sql/UDF/Catalog.scala
#	sql/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Functions.scala
#	sql/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/st_functions.scala
#	sql/common/src/test/scala/org/apache/sedona/sql/dataFrameAPITestScala.scala
#	sql/common/src/test/scala/org/apache/sedona/sql/functionTestScala.scala
Refactored function name
Made java tests more comprehensive by checking both nDims and WKT of returned geometry
Added more test cases in scala test cases
Updated documentation with empty geometry case and more examples
…GN5117/sedona into develop_Nilesh_1.4.1_Translate

# Conflicts:
#	common/src/main/java/org/apache/sedona/common/Functions.java
#	common/src/main/java/org/apache/sedona/common/utils/GeomUtils.java
#	common/src/test/java/org/apache/sedona/common/FunctionsTest.java
#	flink/src/main/java/org/apache/sedona/flink/Catalog.java
#	flink/src/main/java/org/apache/sedona/flink/expressions/Functions.java
#	flink/src/test/java/org/apache/sedona/flink/FunctionTest.java
#	python/sedona/sql/st_functions.py
#	python/tests/sql/test_function.py
#	sql/common/src/main/scala/org/apache/sedona/sql/UDF/Catalog.scala
#	sql/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Functions.scala
#	sql/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/st_functions.scala
#	sql/common/src/test/scala/org/apache/sedona/sql/dataFrameAPITestScala.scala
#	sql/common/src/test/scala/org/apache/sedona/sql/functionTestScala.scala
Added geom collection test cases for force3D
This reverts commit 19016ae.
# Conflicts:
#	common/src/test/java/org/apache/sedona/common/FunctionsTest.java
#	flink/src/main/java/org/apache/sedona/flink/Catalog.java
#	flink/src/main/java/org/apache/sedona/flink/expressions/Functions.java
#	python/sedona/sql/st_functions.py
#	python/tests/sql/test_function.py
#	sql/common/src/main/scala/org/apache/sedona/sql/UDF/Catalog.scala
#	sql/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Functions.scala
#	sql/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/st_functions.scala
#	sql/common/src/test/scala/org/apache/sedona/sql/dataFrameAPITestScala.scala
#	sql/common/src/test/scala/org/apache/sedona/sql/functionTestScala.scala
@@ -178,14 +179,10 @@ object Catalog {
function[RS_Array](),
function[RS_Normalize](),
function[RS_Append](),
function[RS_AddBandFromArray](),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove other functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an accident while merging with master.
I have reverted this

if (geometry.isEmpty()) {
return GEOMETRY_FACTORY.createLineString();
}else {
Envelope envelope = geometry.getEnvelopeInternal();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getEnvelopeInternal() also traverses all coordinates I guess. Why not just have a single loop and traverse all coordinates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I started out with that initially but ended up using envelope for simplicity. I did not take into account its internal implementation.
Reverted to using 1 loop

Revert accidental incorrect removals from Catalog while merging with master
@@ -15,6 +15,7 @@

import com.google.common.geometry.S2CellId;
import com.google.common.math.DoubleMath;
import com.sun.org.apache.xpath.internal.operations.Mult;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this import? I don't think this is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must've been added automatically due to a mistype, removed it.

Copy link
Member

@jiayuasu jiayuasu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And, as Kristin is gonna cut the 1.4.1 release today, this new API will be published in Sedona 1.5.0. Please update the version num in this PR accordingly. I will merge this PR after Kristin cuts the release.

@jiayuasu jiayuasu added this to the sedona-1.5.0 milestone Jun 20, 2023
Updated 'since' to 1.5.0 in documentation
@iGN5117
Copy link
Contributor Author

iGN5117 commented Jun 20, 2023

And, as Kristin is gonna cut the 1.4.1 release today, this new API will be published in Sedona 1.5.0. Please update the version num in this PR accordingly. I will merge this PR after Kristin cuts the release.

--Noted, I have updated the documentation to reflect 1.5.0 availability

@jiayuasu jiayuasu merged commit f8800d6 into apache:master Jun 23, 2023
38 of 39 checks passed
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.

None yet

2 participants