Examples: Postgis 1.5.1 Manual
Examples: Postgis 1.5.1 Manual
1 Manual
259 / 315
Note
Pre 1.3, ST_Expand was used in conjunction with distance to do indexable queries.
Something of
the form the_geom && ST_Expand(POINT(10 20), 10) AND ST_Distance(the_geom, POINT(10 20)) < 10 Post 1.2, this was replaced with the easier ST_DWithin construct.
Note
Bounding boxes of all geometries are currently 2-d even if they are 3-dimensional geometries.
Note
Availability: 1.5.0 behavior changed to output double precision instead of float4 coordinates.
Examples
Note
Examples below use US National Atlas Equal Area (SRID=2163) which is a meter projection
See Also
ST_AsEWKT, ST_Buffer, ST_DWithin, ST_GeomFromEWKT,ST_GeomFromText, ST_SRID
7.12.6 ST_Extent
Name
ST_Extent an aggregate function that returns the bounding box that bounds rows of geometries.
Synopsis
box3d_extent 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/Locators SDO_AGGR_MBR
Note
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.
Note
ST_Extent will return boxes with only an x and y component even with (x,y,z) coordinate geometries. To maintain x,y,z
use ST_Extent3D instead.
Note
Availability: 1.4.0 As of 1.4.0 now returns a box3d_extent instead of box2d object.
Examples
Note
Examples below use Massachusetts State Plane ft (SRID=2249)