You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by GitBox <gi...@apache.org> on 2022/10/14 11:05:51 UTC
[GitHub] [incubator-sedona] Kontinuation opened a new pull request, #700: WIP: [SEDONA-177] Extend RDD API for RangeQuery JoinQuery to support spatial predicates other than coveredBy and intersects.
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: dev-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-sedona] jiayuasu commented on pull request #700: [SEDONA-177] Extend RDD API for RangeQuery JoinQuery to support spatial predicates other than coveredBy and intersects.
Posted by GitBox <gi...@apache.org>.
jiayuasu commented on PR #700:
URL: https://github.com/apache/incubator-sedona/pull/700#issuecomment-1279827573
I think this PR looks good to me. If Pawel wants to take care of the Python wrapper side in a follow-up PR, I can just merge this PR.
--
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: dev-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-sedona] jiayuasu merged pull request #700: [SEDONA-177] Extend RDD API for RangeQuery JoinQuery to support spatial predicates other than coveredBy and intersects.
Posted by GitBox <gi...@apache.org>.
jiayuasu merged PR #700:
URL: https://github.com/apache/incubator-sedona/pull/700
--
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: dev-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-sedona] jiayuasu commented on pull request #700: [SEDONA-177] Extend RDD API for RangeQuery JoinQuery to support spatial predicates other than coveredBy and intersects.
Posted by GitBox <gi...@apache.org>.
jiayuasu commented on PR #700:
URL: https://github.com/apache/incubator-sedona/pull/700#issuecomment-1279827331
@Imbruced This great PR introduces a set of new Spatial Predicates (https://github.com/apache/incubator-sedona/pull/700/files#diff-1ed309b8e78014ee8b34da22e2a1f90894f1d99590924f85ac88b730962f21ce) to address some corner cases in Sedona range and join queries.
For the Python SQL part, this change should be transparent. But for the Python RDD part, we need to introduce a Python wrapper around it. Do you want to take care of this part?
--
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: dev-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org