<refnamediv>
<refname>ST_Envelope</refname>
- <refpurpose>Returns a geometry representing the bounding box of the
+ <refpurpose>Returns a geometry representing the double precision (float8) bounding box of the
supplied geometry.</refpurpose>
</refnamediv>
<refsection>
<title>Description</title>
- <para>Returns the float4 minimum bounding box for the supplied geometry, as a geometry.
+ <para>Returns the float8 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>),
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>Availability: 1.5.0 behavior changed to output double precision instead of float4</para>
<para>&sfs_compliant; s2.1.1.1</para>
<para>&sqlmm_compliant; SQL-MM 3: 5.1.15</para>
</refsection>
SELECT Box3D(geom), Box2D(geom), ST_AsText(ST_Envelope(geom)) As envelopewkt
FROM (SELECT 'POLYGON((0 0, 0 1000012333334.34545678, 1.0000001 1, 1.0000001 0, 0 0))'::geometry As geom) As foo;
-box3d
------------------------------------------
-BOX3D(0 0 0,1.0000001 1000012333334.35 0)
-
-box2d
-------------------------------------------
-BOX(0 0,1.00000011920929 1000012382208)
-
-envelopewkt
--------------------------------------------------------------------
-POLYGON((0 0,0 1000012382208,1.00000011920929 1000012382208,1.00000011920929 0,0 0))
+<!-- TODO: Fix examples to reflect new behavior -->
</programlisting>
</refsection>
<refsection>
<refentry id="ST_Expand">
<refnamediv>
<refname>ST_Expand</refname>
- <refpurpose>Returns bounding box expanded in all directions from the bounding box of the input geometry</refpurpose>
+ <refpurpose>Returns bounding box expanded in all directions from the bounding box of the input geometry. Uses double-precision</refpurpose>
</refnamediv>
<refsynopsisdiv>
<para>This function returns a bounding box expanded in all
directions from the bounding box of the input geometry, by an
- amount specified in the second argument. Very useful for
+ amount specified in the second argument. Uses double-precision. Very useful for
distance() queries, or bounding box queries to add an index filter to the query.</para>
<para>There are 3 variants of this. The one that takes a geometry will return a POLYGON geometry representation
of the bounding box and is the most commonly used variant.</para>
<note>
<para>Bounding boxes of all geometries are currently 2-d even if they are 3-dimensional geometries.</para>
</note>
+
+ <note>
+ <para>Availability: 1.5.0 behavior changed to output double precision instead of float4 coordinates.</para>
+ </note>
</refsection>
<title>Examples</title>
<note><para>Examples below use US National Atlas Equal Area (SRID=2163) which is a meter projection</para></note>
<programlisting>
+ <!-- TODO: fix results of documentation to reflect new behavior -->
--10 meter expanded box around bbox of a linestring
SELECT CAST(ST_Expand(ST_GeomFromText('LINESTRING(2312980 110676,2312923 110701,2312892 110714)', 2163),10) As box2d);
st_expand