You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by "Dimitris Bilidas (Jira)" <ji...@apache.org> on 2022/04/25 10:06:00 UTC

[jira] [Created] (SEDONA-119) ST_Touches join query returns true for polygons whose interiors intersect

Dimitris Bilidas created SEDONA-119:
---------------------------------------

             Summary: ST_Touches join query returns true for polygons whose interiors intersect
                 Key: SEDONA-119
                 URL: https://issues.apache.org/jira/browse/SEDONA-119
             Project: Apache Sedona
          Issue Type: Bug
            Reporter: Dimitris Bilidas


Consider the following example:

 
{code:java}
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) ") {code}
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:
{code:java}
select * from polygondf1 where ST_Touches(polygondf1.p1,ST_GeomFromWKT('POLYGON ((0 0, 1 1, 1 0, 0 0))')){code}
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.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)