Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sdo_inside without spatial index

Sreelatha PragadapatiJan 9 2018 — edited Jan 19 2018

Hi,
My colleague was trying to compare a sdo_geometry object value of a table with her own sdo_geometry object something like this below
select * from all_polygon where
sdo_inside(sdo_geometry(2001, 1041001, sdo_point_type(-2048001.95214638,401006.443211881, NULL), NULL, NULL),
all_polygon.coordinates)  = 'TRUE';

ORA-13226: interface not supported without a spatial index
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 8
ORA-06512: at "MDSYS.SDO_3GL", line 88
ORA-06512: at "MDSYS.SDO_3GL", line 409
13226. 00000 -  "interface not supported without a spatial index"
*Cause:    The geometry table does not have a spatial index.
*Action:  Verify that the geometry table referenced in the spatial operator
          has a spatial index on it.


then I tried to give a table to her list of coordinates, then created sdo_geometry type object for the same in the table, created index and executed the below:

create table temp_geocode as select * from temp_prem where 1=2;

insert into temp_geocode(latitude,longitude) values (401006.443211881,-2048001.95214638);

alter table temp_geocode add temp_geom sdo_geometry;

update temp_geocode set temp_geom = sdo_geometry(2001, 1041001, sdo_point_type(-2048001.95214638,401006.443211881, NULL), NULL, NULL) where latitude is not null;

select * from USER_SDO_GEOM_METADATA;

insert into USER_SDO_GEOM_METADATA values ('TEMP_GEOCODE','TEMP_GEOM', MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-20000000,20000000,0.005),MDSYS.SDO_DIM_ELEMENT('X',-20000000,20000000,0.005)), 1041001);

CREATE INDEX index_temp ON temp_geocode(temp_geom)     INDEXTYPE IS MDSYS.SPATIAL_INDEX;

set Serveroutput On;
declare
b_geom SDO_GEOMETRY;
x integer;
begin
select temp_geom into b_geom from temp_geocode;
select 1 into x from all_polygon where
sdo_inside(b_geom,all_polygon.coordinates)  = 'TRUE';
dbms_output.put_line(x);
end;
still I am getting error:

Error report -
ORA-13226: interface not supported without a spatial index
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 8
ORA-06512: at "MDSYS.SDO_3GL", line 88
ORA-06512: at "MDSYS.SDO_3GL", line 409
ORA-06512: at line 8
13226. 00000 -  "interface not supported without a spatial index"
*Cause:    The geometry table does not have a spatial index.
*Action:  Verify that the geometry table referenced in the spatial operator
          has a spatial index on it.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2018
Added on Jan 9 2018
2 comments
2,215 views