Description

This function returns a bounding box expanded from the bounding box of the input,
either by specifying a single distance with which the box should be expanded in all
directions, or by specifying an expansion distance for each direction.
Uses double-precision. Can be very useful for distance queries, or to add a bounding box
filter to a query to take advantage of a spatial index.

In addition to the geometry version of ST_Expand, which is the most commonly used, variants
are provided that accept and produce internal BOX2D and BOX3D data types.

ST_Expand is similar in concept to ST_Buffer, except while buffer expands the geometry in all directions,
ST_Expand expands the bounding box an x,y,z unit amount.

Units are in the units of the spatial reference system in use denoted by the SRID.

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.