Kontinuation opened a new pull request, #700: URL: https://github.com/apache/incubator-sedona/pull/700
## Did you read the Contributor Guide? - Yes, I have read [Contributor Rules](https://sedona.apache.org/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/community/develop/) ## Is this PR related to a JIRA ticket? - Yes, the URL of the assoicated JIRA ticket is https://issues.apache.org/jira/browse/SEDONA-177. ## What changes were proposed in this PR? We've extended the RDD APIs for range query and spatial/distance join query. ### Spatial Predicate Enums We'll define 9 commonly used spatial predicates in enum `SpatialPredicate`: ```java public enum SpatialPredicate { CONTAINS, INTERSECTS, WITHIN, COVERS, COVERED_BY, TOUCHES, OVERLAPS, CROSSES, EQUALS } ``` ### Spatial Range Query User can specify one of the spatial predicates in `RangeQuery.SpatialRangeQuery`. ```java val rangeQueryWindow = new Envelope(-90.01, -80.01, 30.01, 40.01) val usingIndex = false var queryResult = RangeQuery.SpatialRangeQuery(spatialRDD, rangeQueryWindow, SpatialPredicate.COVERED_BY, usingIndex) // this is equivalent to // RangeQuery.SpatialRangeQuery(rangeQueryWindow, spatialRDD, SpatialPredicate.COVERS, usingIndex) // or // val considerBoundaryIntersection = false // RangeQuery.SpatialRangeQuery(spatialRDD, rangeQueryWindow, considerBoundaryIntersection, usingIndex) ``` ### Spatial Join Query User can specify one of the spatial predicates in `JoinQuery.SpatialJoinQuery`. ```java val usingIndex = false var result = JoinQuery.SpatialJoinQuery(objectRDD, queryWindowRDD, usingIndex, SpatialPredicate.COVERED_BY) // this is equivalent to // val considerBoundaryIntersection = false // JoinQuery.SpatialJoinQuery(objectRDD, queryWindowRDD, usingIndex, considerBoundaryIntersection) var result = JoinQuery.SpatialJoinQuery(objectRDD, queryWindowRDD, usingIndex, SpatialPredicate.INTERSECTS) // this is equivalent to // val considerBoundaryIntersection = true // JoinQuery.SpatialJoinQuery(objectRDD, queryWindowRDD, usingIndex, considerBoundaryIntersection) ``` ### Distance Join Query `JoinQuery.DistanceJoinQuery` only accepts `INTERSECTS` or `COVERED_BY` as spatial predicates. ```java val usingIndex = false var result = JoinQuery.DistanceJoinQuery(objectRDD, queryRDD, usingIndex, SpatialPredicate.COVERED_BY) // this is equivalent to // val considerBoundaryIntersection = false // JoinQuery.DistanceJoinQuery(objectRDD, queryRDD, usingIndex, considerBoundaryIntersection) ``` ### Spatial join optimizer in Sedona SQL Spatial join executors now correctly evaluate spatial predicates (ST_*), which resolves [SEDONA-119](https://issues.apache.org/jira/browse/SEDONA-119). ## How was this patch tested? Added test cases for newly added APIs. The new data files containing test data were randomly generated. Added test cases for [SEDONA-119](https://issues.apache.org/jira/browse/SEDONA-119), which checks whether spatial predicates as spatial join conditions were correctly evaluated. ## Did this PR include necessary documentation updates? - **TODO** ~~Yes, I have updated the documentation update.~~ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
