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

ST_Touches join query returns true for polygons whose interiors intersect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2.1
    • 1.3.0
    • None

    Description

      Consider the following example:

       

      var polygonDf1 = sparkSession.sql("select ST_GeomFromWKT('POLYGON ((0 0, 10 10, 10 0, 0 0))') as p1")
      polygonDf1.createOrReplaceTempView("polygondf1")    
      
      var polygonDf2 = sparkSession.sql("select ST_GeomFromWKT('POLYGON ((0 0, 1 1, 1 0, 0 0))') as p2")
      polygonDf2.createOrReplaceTempView("polygondf2")
      
      var rangeJoinDf = sparkSession.sql("select * from polygondf1, polygondf2 where ST_Touches(polygondf1.p1,polygondf2.p2) ") 

      The correct result should be empty, but SEDONA returns a result.

       

      In case of a spatial filter, the correct result is returned. That is, if we replace the last query with:

      select * from polygondf1 where ST_Touches(polygondf1.p1,ST_GeomFromWKT('POLYGON ((0 0, 1 1, 1 0, 0 0))'))

      Then, the result is indeed empty.

      I have checked that JTS version 1.18.2 returns the correct answer, so the problem must be somewhere else.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dbilid Dimitris Bilidas
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: