<title>Geometry Accessors</title>
<variablelist>
- <varlistentry>
- <term>ST_Dimension(geometry)</term>
-
- <listitem>
- <para>The inherent dimension of this Geometry object, which must
- be less than or equal to the coordinate dimension. OGC SPEC
- s2.1.1.1 - returns 0 for points, 1 for lines, 2 for polygons, and
- the largest dimension of the components of a
- GEOMETRYCOLLECTION.</para>
-
- <programlisting>SELECT ST_Dimension('GEOMETRYCOLLECTION(LINESTRING(1 1,0 0),POINT(0 0))');
-ST_Dimension
------------
-1</programlisting>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>ST_IsEmpty(geometry)</term>
linkend="dropbbox">dropBBOX()</link> to control caching.</para>
</listitem>
</varlistentry>
-
- <varlistentry id="ndims">
- <term>ST_ndims(geometry)</term>
-
- <listitem>
- <para>Returns number of dimensions of the geometry as a small int.
- Values are: 2,3 or 4.</para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>ST_nrings(geometry)</term>
</listitem>
</varlistentry>
- <varlistentry>
- <term>ST_Dimension</term>
-
- <listitem>
- <para>Return the dimension of the ST_Geometry value.</para>
-
- <para>SQL-MM 3: 5.1.2</para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>ST_Disjoint</term>
</sect1>
<sect1>
- <title>Geometry Accessors</title>
+ <title>Geometry Accessors</title>
+ <refentry id="ST_Dimension">
+ <refnamediv>
+ <refname>ST_Dimension</refname>
+
+ <refpurpose>The inherent dimension of this Geometry object, which must
+ be less than or equal to the coordinate dimension. </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>integer <function>ST_Dimension</function></funcdef>
+
+ <paramdef><type>geometry </type> <parameter>g</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsection>
+ <title>Description</title>
+ <para>The inherent dimension of this Geometry object, which must
+ be less than or equal to the coordinate dimension. OGC SPEC
+ s2.1.1.1 - returns 0 for <varname>POINT</varname>, 1 for <varname>LINESTRING</varname>, 2 for <varname>POLYGON</varname>, and
+ the largest dimension of the components of a
+ <varname>GEOMETRYCOLLECTION</varname>.</para>
+
+ <para><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/check.png" />
+ </imageobject>
+ </inlinemediaobject> This method implements the SQL/MM specification:
+ SQL-MM 3: 5.1.2</para>
+ </refsection>
+
+ <refsection>
+ <title>Examples</title>
+
+ <programlisting>SELECT ST_Dimension('GEOMETRYCOLLECTION(LINESTRING(1 1,0 0),POINT(0 0))');
+ST_Dimension
+-----------
+1</programlisting>
+ </refsection>
+ <refsection>
+ <title>See Also</title>
+
+ <para><xref linkend="ST_NDims" /></para>
+ </refsection>
+ </refentry>
+
<refentry id="ST_EndPoint">
<refnamediv>
<refname>ST_EndPoint</refname>
<para><xref linkend="ST_IsRing" /></para>
</refsection>
</refentry>
+
+ <refentry id="ST_NDims">
+ <refnamediv>
+ <refname>ST_NDims</refname>
+ <refpurpose>Returns coordinate dimension of the geometry as a small int.
+ Values are: 2,3 or 4.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>integer <function>ST_NDims</function></funcdef>
+ <paramdef><type>geometry </type> <parameter>g1</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsection>
+ <title>Description</title>
+
+ <para>Returns the coordinate dimension of the geometry. PostGIS supports 2 - (x,y) ,
+ 3 - (x,y,z) or 2D with measure - x,y,m, and 4 - 3D with measure space x,y,z,m</para>
+ </refsection>
+
+ <refsection>
+ <title>Examples</title>
+
+ <programlisting>SELECT ST_NDims(ST_GeomFromText('POINT(1 1)')) As d2point,
+ ST_NDims(ST_GeomFromEWKT('POINT(1 1 2)')) As d3point,
+ ST_NDims(ST_GeomFromEWKT('POINTM(1 1 0.5)')) As d2pointm;
+
+ d2point | d3point | d2pointm
+---------+---------+----------
+ 2 | 3 | 3
+ </programlisting>
+ </refsection>
+ <refsection>
+ <title>See Also</title>
+ <para><xref linkend="ST_Dimension" />, <xref linkend="ST_GeomFromEWKT" /></para>
+ </refsection>
+ </refentry>
<refentry id="ST_NPoints">
<refnamediv>
<refsection>
<title>See Also</title>
- <para><xref linkend="ST_Contains"/>, <xref linkend="ST_Crosses"/>, <xref linkend="ST_Intersects"/></para>
+ <para><xref linkend="ST_Contains"/>, <xref linkend="ST_Crosses"/>, <xref linkend="ST_Dimension"/>, <xref linkend="ST_Intersects"/></para>
</refsection>
</refentry>
<refentry id="ST_Perimeter">