]> granicus.if.org Git - postgis/commitdiff
moved ST_Envelope, complete with examples.
authorKevin Neufeld <kneufeld.ca@gmail.com>
Wed, 16 Jul 2008 06:42:00 +0000 (06:42 +0000)
committerKevin Neufeld <kneufeld.ca@gmail.com>
Wed, 16 Jul 2008 06:42:00 +0000 (06:42 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2863 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference.xml
doc/reference_new.xml

index 1952d58d75aae6c341377ecfcb6f4a5ea8c53ecf..7b17c44a9369b585ad8ff42022c529686b52340c 100644 (file)
@@ -475,24 +475,6 @@ ST_Dimension
           </listitem>
         </varlistentry>
 
-        <varlistentry>
-          <term>ST_Envelope(geometry)</term>
-
-          <listitem>
-            <para>Returns a vald geometry (POINT, LINESTRING or POLYGON)
-            representing the bounding box of the geometry. Degenerate cases
-            (vertical lines, point) will return a geometry of lower dimension
-            than POLYGON.</para>
-
-            <para>OGC SPEC s2.1.1.1 - The minimum bounding box for this
-            Geometry, returned as a Geometry. The polygon is defined by the
-            corner points of the bounding box ((MINX, MINY), (MAXX, MINY),
-            (MAXX, MAXY), (MINX, MAXY), (MINX, MINY)).</para>
-
-            <para>NOTE:PostGIS will add a Zmin/Zmax coordinate as well.</para>
-          </listitem>
-        </varlistentry>
-
         <varlistentry>
           <term>ST_IsEmpty(geometry)</term>
 
@@ -1094,18 +1076,6 @@ GROUP BY gid, field1,field2;
       <title>Management Functions</title>
 
       <variablelist>
-        <varlistentry>
-          <term>UpdateGeometrySRID([&lt;schema_name&gt;], &lt;table_name&gt;,
-          &lt;column_name&gt;, &lt;srid&gt;)</term>
-
-          <listitem>
-            <para>Update the SRID of all features in a geometry column
-            updating constraints and reference in geometry_columns. Note: uses
-            current_schema() on schema-aware pgsql installations if schema is
-            not provided.</para>
-          </listitem>
-        </varlistentry>
-
         <varlistentry>
           <term>update_geometry_stats([&lt;table_name&gt;,
           &lt;column_name&gt;])</term>
@@ -2812,17 +2782,6 @@ WHERE n*100.00/length &lt; 1;
         </listitem>
       </varlistentry>
 
-      <varlistentry>
-        <term>ST_Envelope</term>
-
-        <listitem>
-          <para>Return the bounding rectangle for the ST_Geometry
-          value.</para>
-
-          <para>SQL-MM 3: 5.1.15</para>
-        </listitem>
-      </varlistentry>
-
       <varlistentry>
         <term>ST_Equals</term>
 
index 17e2ebf8b3030b7339fd950062db236d292d8820..70b9eacf3c6220db5a48778bfd580174e5c57148 100644 (file)
@@ -412,6 +412,100 @@ FROM userpoints ;
    
   <sect1>
       <title>Geometry Accessors</title>
+      
+      <refentry id="ST_Envelope">
+  <refnamediv>
+    <refname>ST_Envelope</refname>
+
+    <refpurpose>Returns a geometry representing the bounding box of the
+    supplied geometry.</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <funcsynopsis>
+      <funcprototype>
+        <funcdef>boolean <function>ST_Envelope</function></funcdef>
+
+        <paramdef><type>geometry </type> <parameter>g1</parameter></paramdef>
+      </funcprototype>
+    </funcsynopsis>
+  </refsynopsisdiv>
+
+  <refsection>
+    <title>Description</title>
+
+    <para>Returns the minimum bounding box for the supplied geometry, as a geometry.
+    The polygon is defined by the corner points of the bounding box
+    ((<varname>MINX</varname>, <varname>MINY</varname>),
+    (<varname>MINX</varname>, <varname>MAXY</varname>),
+    (<varname>MAXX</varname>, <varname>MAXY</varname>),
+    (<varname>MAXX</varname>, <varname>MINY</varname>),
+    (<varname>MINX</varname>, <varname>MINY</varname>)). (PostGIS will add a
+    <varname>ZMIN</varname>/<varname>ZMAX</varname> coordinate as
+    well).</para>
+
+    <para>Degenerate cases (vertical lines, points) will return a geometry of
+    lower dimension than <varname>POLYGON</varname>, ie.
+    <varname>POINT</varname> or <varname>LINESTRING</varname>.</para>
+
+    <caution>
+      <para>In PostGIS, the bounding box of a geometry is represented internally using 
+      <varname>float4</varname>s instead of <varname>float8</varname>s that are used 
+      to store geometries.  The bounding box coordinates are floored, guarenteeing 
+      that the geometry is contained entirely within its bounds.  This has the 
+      advantage that a geometry's bounding box is half the size as the minimum
+      bounding rectangle, which means significantly faster indexes and general performance.  
+      But it also means that the bounding box is NOT the same as the minimum bounding 
+      rectangle that bounds the geometry.</para>
+    </caution>
+    
+    <para><inlinemediaobject>
+        <imageobject>
+          <imagedata fileref="images/check.png" />
+        </imageobject>
+      </inlinemediaobject> This method implements the <ulink
+    url="http://www.opengeospatial.org/standards/sfs">OpenGIS Simple Features
+    Implementation Specification for SQL: v1.1: s2.1.1.1</ulink></para>
+
+    <para><inlinemediaobject>
+        <imageobject>
+          <imagedata fileref="images/check.png" />
+        </imageobject>
+      </inlinemediaobject> This method implements the SQL/MM specification:
+    SQL-MM 3: 5.1.15</para>
+  </refsection>
+
+  <refsection>
+    <title>Examples</title>
+
+    <programlisting>
+SELECT ST_AsText(ST_Envelope('POINT(1 3)'::geometry));
+ st_astext  
+------------
+ POINT(1 3)
+(1 row)
+
+
+SELECT ST_AsText(ST_Envelope('LINESTRING(0 0, 1 3)'::geometry));
+           st_astext            
+--------------------------------
+ POLYGON((0 0,0 3,1 3,1 0,0 0))
+(1 row)
+
+
+SELECT ST_AsText(ST_Envelope('POLYGON((0 0, 0 1, 1.0000001 1, 1.0000001 0, 0 0))'::geometry));
+                          st_astext                           
+--------------------------------------------------------------
+ POLYGON((0 0,0 1,1.00000011920929 1,1.00000011920929 0,0 0))
+(1 row)
+SELECT ST_AsText(ST_Envelope('POLYGON((0 0, 0 1, 1.0000000001 1, 1.0000000001 0, 0 0))'::geometry));
+                          st_astext                           
+--------------------------------------------------------------
+ POLYGON((0 0,0 1,1.00000011920929 1,1.00000011920929 0,0 0))
+(1 row)</programlisting>
+  </refsection>
+</refentry>
+      
   </sect1>
   
   <sect1>