I am learning the oracle spatial database, but am stuck on SDO_GEOMETRY
. Actually this object has the following structure:
CREATE TYPE sdo_geometry AS OBJECT(
SDO_GTYPE NUMBER,
SDO_SRID NUMBER,
SDO_POINT SDO_POINT_TYPE,
SDO_ELEM_INFO SDO_ELEM_INFO_ARRAY,
SDO_ORDINATES SDO_ORDINATE_ARRAY);
I shall quote the two attributes SDO_GTYPE
and SDO_ELEM_INFO
from the official oracle docs.
SDO_GTYPE
:
SDO_GTYPE indicates the type of the geometry. Valid geometry types correspond to those specified in the Geometry Object Model for the OGIS Simple Features for SQL specification (with the exception of Surfaces.)
SDO_ELEM_INFO_ARRAY
:
This attribute lets you know how to interpret the ordinates stored in the SDO_ORDINATES attribute
My problem is that I am not been able to differentiate one from the other. Is not the type of geometry actually how we interpret the coordinates? For example, look at the following insert
query. It first says the geometry is a 2D polygon, and after few lines it asks to interpret the coordinates as circle:
INSERT INTO cola_markets VALUES(
4,
'cola_d',
SDO_GEOMETRY(
2003, -- 2-dimensional polygon
NULL,
NULL,
SDO_ELEM_INFO_ARRAY(1,1003,4), -- one circle
SDO_ORDINATE_ARRAY(8,7, 10,9, 8,11)
)
);
Kindly, tell me what is wrong in my perception. Thanks for reading.