ST_Expand

Determine the rectangle that results when the minimum bounding rectangle (MBR) of a geometry is expanded by a specified distance.

Syntax

ST_Expand(geo, distance[, unit[, cSys]]);
geo
The input geometry.

Type: VARCHAR(ANY)

distance
The distance by which to expand the input geometry's MBR.

Type: DOUBLE

unit
The units. Possible values include 'meter', 'kilometer', 'foot', 'mile', and 'nautical mile'.

Type: VARCHAR(ANY)

Default: 'meter'

Returns

A value of type VARCHAR(200) that contains a polygon that is a rectangle the size of the input geometry's MBR expanded by the specified distance.

Examples

SELECT inza..ST_AsText(inza..ST_Expand(inza..ST_WKTToSQL('POLYGO N ((10 10, 10 20, 20 20, 20 15, 10 10))', 1234), 100));

ST_ASTEXT
-----------
POLYGON ((-90 -90, -90 120, 120 120, 120 -90, -90 -90))
(1 row)
SELECT inza..ST_AsText(inza..ST_Expand(inza..ST_WKTToSQL('POLYGO N ((10 10, 10 20, 20 20, 20 15, 10 10))', 1234), 100, 'foot'));

ST_ASTEXT
-----------
POLYGON ((-20.48 -20.48, -20.48 50.48, 50.48 50.48, 50.48 -20.48, -20.48 -20.48))
(1 row)
SELECT inza..ST_AsText(inza..ST_Expand(inza..ST_WKTToSQL('POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))', 1234), 100, 'meter', 'wgs84'));

ST_ASTEXT
-----------
POLYGON ((9.99904440725798 9.99909590432257, 9.99904440725798 20.0009033073281,20.000955592742 20.0009033073281, 
20.000955592742 9.99909590432257, 9.99904440725798 9.99909590432257))
(1 row)