sedona icon indicating copy to clipboard operation
sedona copied to clipboard

Complex polygon is not interpreted correctly

Open tociek opened this issue 8 years ago • 2 comments

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: l_fc6b tmp Incorrect: kepler

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.

tociek avatar Aug 13 '18 11:08 tociek

What is ST_isValid saying? It looks like parts of the polygon are crossing.

geoHeil avatar Aug 13 '18 18:08 geoHeil

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?

tociek avatar Sep 03 '18 05:09 tociek