Kristin Cowalcijk created SEDONA-177:
----------------------------------------

             Summary: Support spatial predicates other than INTERSECTS and 
COVERS/COVERED_BY in RangeQuery.SpatialRangeQuery and JoinQuery.SpatialJoinQuery
                 Key: SEDONA-177
                 URL: https://issues.apache.org/jira/browse/SEDONA-177
             Project: Apache Sedona
          Issue Type: Improvement
            Reporter: Kristin Cowalcijk


This is an RDD API improvement which will be helpful for fixing SEDONA-119. The 
major changes are:

*Spatial Predicates*:

We've defined 9 commonly used spatial predicates in {{enum SpatialPredicate}}:
{code:java}
public enum SpatialPredicate {
    CONTAINS,
    INTERSECTS,
    WITHIN,
    COVERS,
    COVERED_BY,
    TOUCHES,
    OVERLAPS,
    CROSSES,
    EQUALS
}
{code}

*Spatial Range Query*:
User can specify one of the spatial predicates in RangeQuery.SpatialRangeQuery.
{code: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)
{code}

*Spatial Join Query*:
User can specify one of the spatial predicates in JoinQuery.SpatialJoinQuery.
{code:java}
val usingIndex = false
var result = JoinQuery.SpatialJoinQuery(objectRDD, queryWindowRDD, usingIndex, 
SpatialPredicate.COVERS)
// 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)
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to