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

RangeQuery.SpatialRangeQuery returns wrong result when "useIndex" is set to false

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.2.0
    • 1.1.0
    • spark-2.4.5-bin-hadoop2.7
      java version "1.8.0_60"

    Description

      类 RangeQuery 里边方法 RangeQuery.SpatialRangeQuery(U originalQueryGeometry, SpatialRDD<T> spatialRDD, boolean considerBoundaryIntersection, boolean useIndex) 方法当传入参数useIndex=false 时查询结果不正确,会返回spatialRDD的所有行作为查询结果。

      错误复现方式如下:

      SpatialRDD pointRDD = new PointRDD(sc, "arealm-small.csv", 0, FileDataSplitter.CSV,true);
      Coordinate[] coordinates = new Coordinate[5];
      coordinates[0] = new Coordinate(-90.01, 30.01);
      coordinates[1] = new Coordinate(-90.01, 40.01);
      coordinates[2] = new Coordinate(-80.01, 40.01);
      coordinates[3] = new Coordinate(-80.01, 30.01);
      coordinates[4] = coordinates[0];
      GeometryFactory geometryFactory = new GeometryFactory();
      Polygon queryGeometry = geometryFactory.createPolygon(coordinates);
      JavaRDD<Geometry> rdd = RangeQuery.SpatialRangeQuery(queryGeometry, spatialRDD, false, false);
      
      

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chenpengchuan chenpengchuan
              Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 0.5h
                  0.5h