<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="gis-class-geometry">
      </a>
      13.4.2.2 Geometry Class
     </h4>
    </div>
   </div>
  </div>
  <p>
   <code class="literal">
    Geometry
   </code>
   is the root class of the
          hierarchy. It is a noninstantiable class but has a number of
          properties, described in the following list, that are common
          to all geometry values created from any of the
   <code class="literal">
    Geometry
   </code>
   subclasses. Particular subclasses
          have their own specific properties, described later.
  </p>
  <p>
   <span class="bold">
    <strong>
     Geometry Properties
    </strong>
   </span>
  </p>
  <p>
   A geometry value has the following properties:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Its
      <span class="bold">
       <strong>
        type
       </strong>
      </span>
      . Each geometry
              belongs to one of the instantiable classes in the
              hierarchy.
     </p>
    </li>
    <li class="listitem">
     <p>
      Its
      <span class="bold">
       <strong>
        SRID
       </strong>
      </span>
      , or spatial
              reference identifier. This value identifies the geometry's
              associated spatial reference system that describes the
              coordinate space in which the geometry object is defined.
     </p>
     <p>
      In MySQL, the SRID value is an integer associated with the
              geometry value. The maximum usable SRID value is
              2
      <sup>
       32
      </sup>
      −1. If a larger value
              is given, only the lower 32 bits are used.
     </p>
     <p>
      SRID 0 represents an infinite flat Cartesian plane with no
              units assigned to its axes. To ensure SRID 0 behavior,
              create geometry values using SRID 0. SRID 0 is the default
              for new geometry values if no SRID is specified.
     </p>
     <p>
      For computations on multiple geometry values, all values
              must have the same SRID or an error occurs.
     </p>
    </li>
    <li class="listitem">
     <p>
      Its
      <span class="bold">
       <strong>
        coordinates
       </strong>
      </span>
      in its
              spatial reference system, represented as double-precision
              (8-byte) numbers. All nonempty geometries include at least
              one pair of (X,Y) coordinates. Empty geometries contain no
              coordinates.
     </p>
     <p>
      Coordinates are related to the SRID. For example, in
              different coordinate systems, the distance between two
              objects may differ even when objects have the same
              coordinates, because the distance on the
      <span class="bold">
       <strong>
        planar
       </strong>
      </span>
      coordinate system
              and the distance on the
      <span class="bold">
       <strong>
        geodetic
       </strong>
      </span>
      system
              (coordinates on the Earth's surface) are different things.
     </p>
    </li>
    <li class="listitem">
     <p>
      Its
      <span class="bold">
       <strong>
        interior
       </strong>
      </span>
      ,
      <span class="bold">
       <strong>
        boundary
       </strong>
      </span>
      , and
      <span class="bold">
       <strong>
        exterior
       </strong>
      </span>
      .
     </p>
     <p>
      Every geometry occupies some position in space. The
              exterior of a geometry is all space not occupied by the
              geometry. The interior is the space occupied by the
              geometry. The boundary is the interface between the
              geometry's interior and exterior.
     </p>
    </li>
    <li class="listitem">
     <p>
      Its
      <span class="bold">
       <strong>
        MBR
       </strong>
      </span>
      (minimum bounding
              rectangle), or envelope. This is the bounding geometry,
              formed by the minimum and maximum (X,Y) coordinates:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa43158334"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-simple"><span class="token punctuation">(</span><span class="token punctuation">(</span>MINX MINY<span class="token punctuation">,</span> MAXX MINY<span class="token punctuation">,</span> MAXX MAXY<span class="token punctuation">,</span> MINX MAXY<span class="token punctuation">,</span> MINX MINY<span class="token punctuation">)</span><span class="token punctuation">)</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Whether the value is
      <span class="bold">
       <strong>
        simple
       </strong>
      </span>
      or
      <span class="bold">
       <strong>
        nonsimple
       </strong>
      </span>
      . Geometry
              values of types (
      <code class="literal">
       LineString
      </code>
      ,
      <code class="literal">
       MultiPoint
      </code>
      ,
      <code class="literal">
       MultiLineString
      </code>
      ) are either simple or
              nonsimple. Each type determines its own assertions for
              being simple or nonsimple.
     </p>
    </li>
    <li class="listitem">
     <p>
      Whether the value is
      <span class="bold">
       <strong>
        closed
       </strong>
      </span>
      or
      <span class="bold">
       <strong>
        not closed
       </strong>
      </span>
      . Geometry
              values of types (
      <code class="literal">
       LineString
      </code>
      ,
      <code class="literal">
       MultiString
      </code>
      ) are either closed or not
              closed. Each type determines its own assertions for being
              closed or not closed.
     </p>
    </li>
    <li class="listitem">
     <p>
      Whether the value is
      <span class="bold">
       <strong>
        empty
       </strong>
      </span>
      or
      <span class="bold">
       <strong>
        nonempty
       </strong>
      </span>
      A geometry is
              empty if it does not have any points. Exterior, interior,
              and boundary of an empty geometry are not defined (that
              is, they are represented by a
      <code class="literal">
       NULL
      </code>
      value). An empty geometry is defined to be always simple
              and has an area of 0.
     </p>
    </li>
    <li class="listitem">
     <p>
      Its
      <span class="bold">
       <strong>
        dimension
       </strong>
      </span>
      . A geometry
              can have a dimension of −1, 0, 1, or 2:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         −1 for an empty geometry.
        </p>
       </li>
       <li class="listitem">
        <p>
         0 for a geometry with no length and no area.
        </p>
       </li>
       <li class="listitem">
        <p>
         1 for a geometry with nonzero length and zero area.
        </p>
       </li>
       <li class="listitem">
        <p>
         2 for a geometry with nonzero area.
        </p>
       </li>
      </ul>
     </div>
     <p>
      <code class="literal">
       Point
      </code>
      objects have a dimension of zero.
      <code class="literal">
       LineString
      </code>
      objects have a dimension of
              1.
      <code class="literal">
       Polygon
      </code>
      objects have a dimension of
              2. The dimensions of
      <code class="literal">
       MultiPoint
      </code>
      ,
      <code class="literal">
       MultiLineString
      </code>
      , and
      <code class="literal">
       MultiPolygon
      </code>
      objects are the same as
              the dimensions of the elements they consist of.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
