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-369] Add ST_DWithin #1175

Merged
merged 7 commits into from
Jan 2, 2024
Merged

Conversation

iGN5117
Copy link
Contributor

@iGN5117 iGN5117 commented Jan 1, 2024

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

  • Add ST_DWithin
  • Add PredicatesTest.java for correctness test cases in Java
  • Added a TestBase.java to reuse helpers between PredicatesTest and FunctionsTest.java

How was this patch tested?

  • Added new tests

Did this PR include necessary documentation updates?

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.

Just a reminder, since ST_DWithIn is a spatial predicate, we need to support it in our optimized spatial join. You can address this issue in another PR.

@@ -49,4 +49,11 @@ public static boolean disjoint(Geometry leftGeometry, Geometry rightGeometry) {
public static boolean orderingEquals(Geometry leftGeometry, Geometry rightGeometry) {
return leftGeometry.equalsExact(rightGeometry);
}
public static boolean dWithin(Geometry leftGeometry, Geometry rightGeometry, double distance) {
int leftSrid = leftGeometry.getSRID(), rightSrid = rightGeometry.getSRID();
Copy link
Member

Choose a reason for hiding this comment

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

I suggest that we don't perform CRS check in Predicates because all other predicates do not check it.

If we want to enforce this check, please raise another PR for this specific issue. Moreover, what is the default value of SRID if the user don't specify it at all? I think it is 0? If so, this check will work. If it is null, then this check will not work.

@jiayuasu jiayuasu merged commit 1cc4c82 into apache:master Jan 2, 2024
47 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