Error while using Spatial Index

Database
Enthusiast

Error while using Spatial Index

I'm trying to use Spatial Index to get optimal performance on Geometry data and ended up with an error.

Please find the index and table definition and the query which fails while using the spatial index.

DBS v13.10.04.12

1. Spatial Index

REPLACE FUNCTION SYSSPATIAL.tessellate_index

(

    o_xmin DOUBLE PRECISION,

    o_ymin DOUBLE PRECISION,

    o_xmax DOUBLE PRECISION,

    o_ymax DOUBLE PRECISION,

    u_xmin DOUBLE PRECISION,

    u_ymin DOUBLE PRECISION,

    u_xmax DOUBLE PRECISION,

    u_ymax DOUBLE PRECISION,

    g_nx INTEGER,

    g_ny INTEGER,

    levels INTEGER,

    scale DOUBLE PRECISION,

    shift INTEGER

)

    RETURNS INTEGER

    LANGUAGE CPP

    DETERMINISTIC

    NO SQL

    SPECIFIC tessellate_index

    EXTERNAL NAME 'SL!udflib'

;

2. Sample Query uses Spatial Index

SELECT cellid MOD 16 AS LEVEL

,(cellid / 16) AS gridnum

FROM (SELECT sysspatial.tessellate_index(11, 11, 12, 12, 0, 0, 100, 100, 10, 10, 2, .5, 0 ) AS cellid) X;

--Output

LEVEL    gridnum

2              11

3. When I try to populate using Geometry data.

CREATE SET TABLE xx_scratch.ra_dyson_point

     (

      dyson_evnt_id DECIMAL(18,0),

      point SYSUDTLIB.ST_GEOMETRY)

UNIQUE PRIMARY INDEX ( dyson_evnt_id );

--data

dyson_evnt_id point

1000438097107   POINT (52.552138 -1.973318)

SELECT

dyson_evnt_id

,sysspatial.tessellate_index (

point.ST_X(),point.ST_Y(), point.ST_X(), point.ST_Y()

,-180, 0, 0, 90

,1000,1000

,1,0.01,0)

FROM xx_scratch.ra_dyson_point;

--we get error

SELECT Failed. 7504:  IN UDF/XSP/UDM SYSSPATIAL.tessellate_index: SQLSTATE 04000:

Inconsistency BETWEEN OBJECT coordinates AND universe coordinates IN TessellationEngine

Any clue/solution to fix this error is greatly appreciated.