From: Regina Obe Date: Wed, 30 Dec 2009 07:20:22 +0000 (+0000) Subject: more clarity on the float4/float8 for ST_Envelope X-Git-Tag: 1.5.0b1~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6dc8929ed822c20886d9f05b21b4cca1f770fc6e;p=postgis more clarity on the float4/float8 for ST_Envelope git-svn-id: http://svn.osgeo.org/postgis/trunk@5073 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_accessor.xml b/doc/reference_accessor.xml index 303f76d42..1c903efbf 100644 --- a/doc/reference_accessor.xml +++ b/doc/reference_accessor.xml @@ -293,7 +293,7 @@ SELECT ST_AsEWKT(ST_EndPoint('LINESTRING(1 1 2, 1 2 3, 0 0 5)')); - + ST_Envelope @@ -314,7 +314,7 @@ SELECT ST_AsEWKT(ST_EndPoint('LINESTRING(1 1 2, 1 2 3, 0 0 5)')); Description - Returns the minimum bounding box for the supplied geometry, as a geometry. + Returns the float4 minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), @@ -347,30 +347,51 @@ SELECT ST_AsEWKT(ST_EndPoint('LINESTRING(1 1 2, 1 2 3, 0 0 5)')); Examples - 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) +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) + +SELECT ST_Box3D(geom), ST_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)) + + + + See Also + + ,