Skip to content

ST_GeomFromGeoJson object passed into ST_Intersects always results True #81

@uamadman

Description

@uamadman

I am using the following header information to test the following select statements.

add jar
  ../lib/esri-geometry-api.jar
  ../lib/spatial-sdk-hadoop.jar;

create temporary function ST_Intersects as 'com.esri.hadoop.hive.ST_Intersects';
create temporary function ST_LineString as 'com.esri.hadoop.hive.ST_LineString';
create temporary function ST_GeomFromGeoJson as 'com.esri.hadoop.hive.ST_GeomFromGeoJson';
create temporary function ST_Polygon as 'com.esri.hadoop.hive.ST_Polygon';

The answer for both select statements is false:

SELECT ST_Intersects(ST_GeomFromGeoJson('{"type": "LineString", "coordinates": [[2.449,4.865], [7.00000001,8.00000001]]}'),ST_GeomFromGeoJson('{"type": "Polygon", "coordinates": [[[1.00000001,1.00000001], [4.00000001,1.00000001], [4.00000001,4.00000001], [1.00000001,4.00000001]]]}'));
returned true

SELECT ST_Intersects(ST_LineString(2.449,4.865, 7.00000001,8.00000001), ST_Polygon(1.00000001,1.00000001, 4.00000001,1.00000001, 4.00000001,4.00000001, 1.00000001,4.00000001));
returned false

The answer for both select statements is true:

SELECT ST_Intersects(ST_GeomFromGeoJson('{"type": "LineString", "coordinates": [[1.00000001,1.00000001], [7.00000001,8.00000001]]}'),ST_GeomFromGeoJson('{"type": "Polygon", "coordinates": [[[1.00000001,1.00000001], [4.00000001,1.00000001], [4.00000001,4.00000001], [1.00000001,4.00000001]]]}'));
returned true

SELECT ST_Intersects(ST_LineString(1.00000001,1.00000001, 7.00000001,8.00000001), ST_Polygon(1.00000001,1.00000001, 4.00000001,1.00000001, 4.00000001,4.00000001, 1.00000001,4.00000001));
returned true

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions