]> granicus.if.org Git - postgis/commitdiff
Add doco and regression tests for ST_MakeEnvelope() (#199)
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 16 Nov 2009 18:46:38 +0000 (18:46 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 16 Nov 2009 18:46:38 +0000 (18:46 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4832 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_constructor.xml
regress/regress.sql
regress/regress_expected

index 2228dc9d5e256457095022fe6eb2169058a8b17b..a07e257ff8e544604232f2d91657921b1799a4fe 100644 (file)
@@ -1096,6 +1096,52 @@ LINESTRING(1 2 3,3 4 5,6 6 6)
                </refsection>
        </refentry>
 
+
+       <refentry id="ST_MakeEnvelope">
+               <refnamediv>
+               <refname>ST_MakeEnvelope</refname>
+
+               <refpurpose>Creates a rectangular Polygon formed from the given minimums and maximums. Input
+                       values must be in SRS specified by the SRID.</refpurpose>
+               </refnamediv>
+
+               <refsynopsisdiv>
+               <funcsynopsis>
+                 <funcprototype>
+                       <funcdef>geometry <function>ST_MakeEnvelope</function></funcdef>
+                       <paramdef><type>double precision</type> <parameter>xmin</parameter></paramdef>
+                       <paramdef><type>double precision</type> <parameter>ymin</parameter></paramdef>
+                       <paramdef><type>double precision</type> <parameter>xmax</parameter></paramdef>
+                       <paramdef><type>double precision</type> <parameter>ymax</parameter></paramdef>
+                       <paramdef><type>integer </type> <parameter>srid</parameter></paramdef>
+                 </funcprototype>
+               </funcsynopsis>
+               </refsynopsisdiv>
+
+               <refsection>
+                       <title>Description</title>
+
+                       <para>Creates a rectangular Polygon formed from the minima and maxima. by the given shell. Input
+                               values must be in SRS specified by the SRID.</para>
+
+               </refsection>
+
+               <refsection>
+               <title>Example: Building an bounding box polygon</title>
+                <programlisting>
+SELECT ST_AsText(ST_MakePolygon(10, 10, 11, 11, 4326));
+
+st_asewkt
+-----------
+POLYGON((10 10, 10 11, 11 11, 11 10, 10 10))
+                         </programlisting>
+               </refsection>
+               <refsection>
+                       <title>See Also</title>
+                       <para><xref linkend="ST_MakePoint" />, <xref linkend="ST_MakeLine" />, <xref linkend="ST_MakePolygon" /></para>
+               </refsection>
+       </refentry>
+
        <refentry id="ST_MakePolygon">
                <refnamediv>
                <refname>ST_MakePolygon</refname>
index b70ba1eb2e2de9c92ef4e4fd557154d70bfbb9e2..6640b949e89700467ff9d78b0dda0cf8122e33eb 100644 (file)
@@ -274,5 +274,9 @@ select '149', ST_astext(segmentize('GEOMETRYCOLLECTION EMPTY', 0.5));
 select '150', ST_asewkt(ST_force_collection(ST_setsrid('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry, 6)));
 select '150_', asewkt(force_collection(setsrid('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry, 6)));
 
+select '151', ST_MakeEnvelope(0, 0, 1, 1, 4326);
+select '152', ST_SRID(ST_MakeEnvelope(0, 0, 1, 1, 4326));
+
+
 -- Drop test table
 DROP table test;
index f2a830952e9b1bee9db630290adb202fc4b4825c..d88936d62e7c9ba29d259c01acda7ffe8ae7a112 100644 (file)
@@ -195,3 +195,5 @@ HINT:  "MULTIPOINT(1 1, 2 2" <-- parse error at position 19 within geometry
 149|GEOMETRYCOLLECTION EMPTY
 150|SRID=6;GEOMETRYCOLLECTION(POLYGON((0 0,1 0,1 1,0 1,0 0)))
 150_|SRID=6;GEOMETRYCOLLECTION(POLYGON((0 0,1 0,1 1,0 1,0 0)))
+151|0103000020E61000000100000005000000000000000000000000000000000000000000000000000000000000000000F03F000000000000F03F000000000000F03F000000000000F03F000000000000000000000000000000000000000000000000
+152|4326