在oracle中为shape字段添加索引

表名为oscline,shape字段的格式为sdo_geometry

INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
 VALUES ('OSCLINE', 'shape',
    MDSYS.SDO_DIM_ARRAY
      (MDSYS.SDO_DIM_ELEMENT('X', -180, 180, 0.00000005),
       MDSYS.SDO_DIM_ELEMENT('Y', -90, 90, 0.00000005)
     ),
     4326);
create index idx_oscline on OSCLINE(shape) indextype is mdsys.spatial_index;

注意:在sql语句中OSCLINE一定要大写

猜你喜欢

转载自blog.csdn.net/baidu_23263735/article/details/82949185