From: Regina Obe Date: Thu, 2 Oct 2008 11:16:15 +0000 (+0000) Subject: Move over ST_Extent X-Git-Tag: 1.4.0b1~675 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5474a5275c037a44eaaeef8a1447aaee91abf836;p=postgis Move over ST_Extent git-svn-id: http://svn.osgeo.org/postgis/trunk@3040 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference.xml b/doc/reference.xml index 679bdf7d5..c6c3b6b0e 100644 --- a/doc/reference.xml +++ b/doc/reference.xml @@ -1446,19 +1446,6 @@ WHERE n*100.00/length < 1; - - ST_extent(geometry set) - - - The extent() function is an "aggregate" function in the - terminology of PostgreSQL. That means that it operators on lists - of data, in the same way the sum() and mean() functions do. For - example, "SELECT ST_Extent(GEOM) FROM GEOMTABLE" will return a - BOX3D giving the maximum extent of all features in the table. - Similarly, "SELECT ST_Extent(GEOM) FROM GEOMTABLE GROUP BY - CATEGORY" will return one extent result for each category. - - ST_zmflag(geometry) diff --git a/doc/reference_new.xml b/doc/reference_new.xml index 0fb24fb2b..28f9845d0 100644 --- a/doc/reference_new.xml +++ b/doc/reference_new.xml @@ -5234,7 +5234,6 @@ POINT(1 2) Misc - ST_Expand @@ -5318,6 +5317,92 @@ SELECT ST_Expand(CAST('BOX3D(778783 2951741 1,794875 2970042.61545891 10)' As bo , , , ,, - + + ST_extent(geometry set) + + + The extent() function is an "aggregate" function in the + terminology of PostgreSQL. That means that it operators on lists + of data, in the same way the sum() and mean() functions do. For + example, "SELECT ST_Extent(GEOM) FROM GEOMTABLE" will return a + BOX3D giving the maximum extent of all features in the table. + Similarly, "SELECT ST_Extent(GEOM) FROM GEOMTABLE GROUP BY + CATEGORY" will return one extent result for each category. + + + + + + ST_Extent + an aggregate function that returns the bounding box that bounds rows of geometries. + + + + + + box2d ST_Extent + geometry set geomfield + + + + + + Description + + ST_Extent returns a bounding box that encloses a set of geometries. The ST_Extent function is an "aggregate" function in the + terminology of SQL. That means that it operates on lists + of data, in the same way the SUM() and AVG() functions do. + Since it returns a bounding box, the spatial Units are in the units of the spatial reference system in use denoted by the SRID + ST_Extent is similar in concept to Oracle Spatial/Locator's SDO_AGGR_MBR + + Since ST_Extent returns a bounding box, the SRID meta-data is lost. Use ST_SetSRID to force it back into + a geometry with SRID meta data. The coordinates are in the units of the spatial ref of the orginal geometries. + + + + Bounding boxes of all geometries are currently 2-d even if they are 3-dimensional geometries. + + + + + + Examples + Examples below use Massachusetts State Plane ft (SRID=2249) + + +SELECT ST_Extent(the_geom) as bextent FROM sometable; + st_bextent +------------------------------------ +BOX(739651.875 2908247.25,794875.8125 2970042.75) + + +--Return extent of each category of geometries +SELECT ST_Extent(the_geom) as bextent +FROM sometable +GROUP BY category ORDER BY category; + + bextent | name +----------------------------------------------------+---------------- + BOX(778783.5625 2951741.25,794875.8125 2970042.75) | A + BOX(751315.8125 2919164.75,765202.6875 2935417.25) | B + BOX(739651.875 2917394.75,756688.375 2935866) | C + + --Force back into a geometry + -- and render the extended text representation of that geometry +SELECT ST_SetSRID(ST_Extent(the_geom),2249) as bextent FROM sometable; + + bextent +-------------------------------------------------------------------------------- + SRID=2249;POLYGON((739651.875 2908247.25,739651.875 2970042.75,794875.8125 2970042.75, + 794875.8125 2908247.25,739651.875 2908247.25)) + + + + + See Also + , , + + +