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-441] Add ST_LineLocatePoint #1178

Merged
merged 12 commits into from
Jan 4, 2024

Conversation

prantogg
Copy link
Contributor

@prantogg prantogg commented Jan 3, 2024

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

Adds Vector function ST_LineLocatePoint

  • Returns a double between 0 and 1, representing the location of the closest point on the LineString as a fraction of its total length.

How was this patch tested?

  • Passes new and existing tests

Did this PR include necessary documentation updates?


Since: `v1.5.1`

Spark SQL Example:
Copy link
Member

Choose a reason for hiding this comment

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

Not Spark SQL. It is SQL

Double expectedResult2 = 0.5;
Double expectedResult3 = 1.0;

assertEquals(expectedResult1, actual1, 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.

I believe our TestBase already has a variable called FP Tolerance

@@ -771,12 +779,6 @@ public void testRemovePointWithIndex() {
assertEquals("LINESTRING (0 0, 2 2)", first(pointTable).getField(0).toString());
}

@Test
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 this test?

@prantogg prantogg requested a review from jiayuasu January 3, 2024 21:27
@jiayuasu jiayuasu linked an issue Jan 4, 2024 that may be closed by this pull request
@jiayuasu jiayuasu merged commit 8deca73 into apache:master Jan 4, 2024
47 checks passed
@jpd-defra
Copy link

Thank you @prantogg and @jiayuasu. This is great to see!

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.

Request for addition of function: ST_LineLocatePoint
3 participants