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]);
geo
The input geometry.

Type: ST_GEOMETRY(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 ST_GEOMETRY(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('POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))', 27700), 100));

ST_ASTEXT
-----------
POLYGON ((-90 -90, 120 -90, 120 120, -90 120, -90 -90))
(1 row)


SELECT inza..ST_AsText(inza..ST_Expand(inza..ST_WKTToSQL('POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))', 27700), 100, 'foot'));

ST_ASTEXT
-----------
POLYGON ((-20.480000000447 -20.480000000447,
50.480000000447 -20.480000000447, 50.480000000447
50.480000000447, -20.480000000447 50.480000000447,
-20.480000000447 -20.480000000447))
(1 row)


SELECT inza..ST_AsText(inza..ST_Expand(inza..ST_Transform(inza..ST_WKTToSQL('POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))', 27700), 4326), 100, 'meter'));
ST_ASTEXT
-----------
POLYGON ((-7.558430215 49.766004321, -7.55551071
49.766004321, -7.55551071 49.767898653, -7.558430215
49.767898653, -7.558430215 49.766004321))
(1 row)