Complex polygon is not interpreted correctly
Expected behavior
ST_CONTAINS should report the following POINT: lat: 52.238039 long: 21.064049 as belonging to the following POLYGON: query-hive-61876.zip
Actual behavior
ST_CONTAINS returns false for this operation
Steps to reproduce the problem
Run SQL with ST_CONTAINS (see attached shape file) polygon.zip
Correct polygon interpretation:
Incorrect:
Settings
GeoSpark version "org.datasyslab" % "geospark" % "1.1.3", "org.datasyslab" % "geospark-sql_2.1" % "1.1.3", Apache Spark version = 2.1
JRE version = 1.8
API type = Scala
Interestingly, when this POLYGON is visualized in Kepler (from Uber), it works the same way as in geospark (so I assume it uses the same libraries at some point), however https://maththinking.com/gisvisualizer/, Alteryx, Spotfire are showing correct results.
What is ST_isValid saying? It looks like parts of the polygon are crossing.
Sorry for late reply. Indeed, the polygon is not valid (according to "isValid" function). Is it possible that it came ok in the shape file, but got converted to invalid in the process of loading the file to geospark? Is there a way to validate shape directly in shapefile?