From: Paul Ramsey Date: Mon, 16 Nov 2009 18:46:38 +0000 (+0000) Subject: Add doco and regression tests for ST_MakeEnvelope() (#199) X-Git-Tag: 1.5.0b1~230 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c212442dff24a48829240070d7a787f4854d285d;p=postgis Add doco and regression tests for ST_MakeEnvelope() (#199) git-svn-id: http://svn.osgeo.org/postgis/trunk@4832 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_constructor.xml b/doc/reference_constructor.xml index 2228dc9d5..a07e257ff 100644 --- a/doc/reference_constructor.xml +++ b/doc/reference_constructor.xml @@ -1096,6 +1096,52 @@ LINESTRING(1 2 3,3 4 5,6 6 6) + + + + ST_MakeEnvelope + + Creates a rectangular Polygon formed from the given minimums and maximums. Input + values must be in SRS specified by the SRID. + + + + + + geometry ST_MakeEnvelope + double precision xmin + double precision ymin + double precision xmax + double precision ymax + integer srid + + + + + + Description + + Creates a rectangular Polygon formed from the minima and maxima. by the given shell. Input + values must be in SRS specified by the SRID. + + + + + Example: Building an bounding box polygon + +SELECT ST_AsText(ST_MakePolygon(10, 10, 11, 11, 4326)); + +st_asewkt +----------- +POLYGON((10 10, 10 11, 11 11, 11 10, 10 10)) + + + + See Also + , , + + + ST_MakePolygon diff --git a/regress/regress.sql b/regress/regress.sql index b70ba1eb2..6640b949e 100644 --- a/regress/regress.sql +++ b/regress/regress.sql @@ -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; diff --git a/regress/regress_expected b/regress/regress_expected index f2a830952..d88936d62 100644 --- a/regress/regress_expected +++ b/regress/regress_expected @@ -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