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-303] Port all Sedona Spark functions to Sedona Flink -- Step 4 #887

Merged
merged 11 commits into from
Jul 8, 2023

Conversation

yyy1000
Copy link
Contributor

@yyy1000 yyy1000 commented Jul 4, 2023

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

  1. Port missing ST_functions including
    {ST_PrecisionReduce and ST_MinimumBoundingCircle}to sedona-flink.
  2. Change the default value of the second param of ST_MinimumBoundingCircle from 8 to 48 and its tests. See https://postgis.net/docs/ST_MinimumBoundingCircle.html for reference.
  3. Change the name of ST_PrecisionReduce to ST_ReducePrecision, and its tests and docs, see https://postgis.net/docs/ST_ReducePrecision.html for reference.

How was this patch tested?

  1. Integration unit tests in sedona-flink.
  2. Integration unit tests in sedona-sql, sedona-flink, and python.

Did this PR include necessary documentation updates?

  • Yes, I have updated the documentation update.

@jiayuasu
Copy link
Member

jiayuasu commented Jul 5, 2023

@yyy1000 Please fix the failed Python tests

@yyy1000
Copy link
Contributor Author

yyy1000 commented Jul 5, 2023

@yyy1000 Please fix the failed Python tests

Fixed it. :)


Introduction: Reduce the decimals places in the coordinates of the geometry to the given number of decimal places. The last decimal place will be rounded.

Format: `ST_PrecisionReduce (A:geometry, B:int)`
Copy link
Member

Choose a reason for hiding this comment

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

Please add one more sentence saying that the name of this function was called ST_PrecisionReduce in versions prior to v1.5.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just noticed that ST_ReducePrecision(geometry g, float8 gridsize); in postgis needs float as the second param. That means use '0.1' as 1, '0.01' as 2. Should we follow the function in postgis?

Copy link
Member

Choose a reason for hiding this comment

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

em... I think the Sedona implementation of this function is very different from PostGIS. I suggest that, in this PR, we don't adopt the PostGIS implementation. We will address this in a different PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think so. Here we can keep Sedona implementation. Should we use the keep the function name the same as PostGIS like 'ST_ReducePrecision '? Or we can revert to the old name 'ST_PrecisionReduce ', which doesn't exsit in PostGIS.

Copy link
Member

Choose a reason for hiding this comment

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

@yyy1000 I think changing to ST_ReducePrecision is fine. No need to revert it back. Just update the doc then we are good to go.

@@ -102,7 +102,7 @@ object Catalog {
function[ST_ClosestPoint](),
function[ST_Boundary](),
function[ST_MinimumBoundingRadius](),
function[ST_MinimumBoundingCircle](BufferParameters.DEFAULT_QUADRANT_SEGMENTS),
Copy link
Member

Choose a reason for hiding this comment

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

Please update the doc in Sedona Spark saying that the default param has been changed.

@yyy1000
Copy link
Contributor Author

yyy1000 commented Jul 7, 2023

I updated the doc. :)


Format: `ST_MinimumBoundingCircle(geom: geometry, [Optional] quadrantSegments:int)`

Since: `v1.0.1`
Copy link
Member

Choose a reason for hiding this comment

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

Why is this version reverted back to v1.0.1? All these functions should be v1.5.0 @yyy1000

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, sorry for missing that. Updated.

@jiayuasu jiayuasu merged commit 467f7ab into apache:master Jul 8, 2023
39 checks passed
@yyy1000 yyy1000 deleted the port4 branch July 9, 2023 03:51
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