Search code examples
oracle-databaseoracle-spatial

How to create Oracle Spatial Index that will store mixed SRIDs?


I am trying to create a spatial index in Oracle Spatial 12C, and I only see an option for creating one with a specific SRID. my geometry column IS an sdo_geometry column type.

I am doing this:

insert into user_sdo_geom_metadata (
  table_name,
  column_name,
  diminfo,
  srid
)
values (
  'items',
  'geometry',
  sdo_dim_array(
  sdo_dim_element('X',-180, 180,1),
  sdo_dim_element('Y',-90,90,1)
),
8307--WGS 84
)

and then this

CREATE INDEX items_geom_idx ON items(geometry)
   INDEXTYPE IS MDSYS.SPATIAL_INDEX;

Is it possible to set up an index that can store geometries with various SRIDs?


Solution

  • If you are asking about creating a spatial index on a column that stores geometries that are in multiple different SRIDs, the answer is: you cannot.

    All geometries in a spatial column must be in the same SRID.