title: Difference between GTYPE and SDO_ELEM_INFO_ARRAY
body: <p>I am learning the oracle spatial database, but am stuck on <code>SDO_GEOMETRY</code>. Actually this object has the following structure:</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>I shall quote the two attributes <code>SDO_GTYPE</code> and <code>SDO_ELEM_INFO</code> from the official oracle docs. 
  <code>SDO_GTYPE</code>:</p>
  
  <blockquote>
    <p><strong>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.)</strong></p>
  </blockquote>
  
  <p><code>SDO_ELEM_INFO_ARRAY</code>:</p>
  
  <blockquote>
    <p><strong>This attribute lets you know how to interpret the ordinates stored in the SDO_ORDINATES attribute</strong></p>
  </blockquote>
  
  <p>My problem is that I am not been able to differentiate one from the other. Is not the <em>type of geometry</em> actually how we interpret the coordinates? For example, look at the following <code>insert</code> query. It first says the geometry is a 2D polygon, and after few lines it asks to interpret the coordinates as circle:</p>
  
  <pre><code>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)
   )
  );
  </code></pre>
  
  <p>Kindly, tell me what is wrong in my perception. Thanks for reading.</p>