Uploaded image for project: 'Apache Sedona'
  1. Apache Sedona
  2. SEDONA-177

Support spatial predicates other than INTERSECTS and COVERS/COVERED_BY in RangeQuery.SpatialRangeQuery and JoinQuery.SpatialJoinQuery

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0

    Description

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

      Spatial Predicates:

      We'll define 9 commonly used spatial predicates in enum SpatialPredicate:

      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.

      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.

      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)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kontinuation Kristin Cowalcijk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m