Skip to main content
Returns a geometry expanded from the bounding box of the input. The expansion can be specified in two ways:
  1. By individual axis using deltaX, deltaY, or deltaZ parameters.
  2. Uniformly across all axes using the uniformDelta parameter.
Things to consider when using this function:
  1. The uniformDelta parameter expands Z dimensions for XYZ geometries; otherwise, it only affects XY dimensions.
  2. For XYZ geometries, specifying only deltaX and deltaY will preserve the original Z dimension.
  3. If the input geometry has an M dimension then using this function will drop the said M dimension.
ST_Expand

Signatures

ST_Expand(geometry: Geometry, uniformDelta: Double)
ST_Expand(geometry: Geometry, deltaX: Double, deltaY: Double)
ST_Expand(geometry: Geometry, deltaX: Double, deltaY: Double, deltaZ: Double)

Parameters

geometry
Geometry
required
The input geometry.
deltaX
Double
The delta x value.
deltaY
Double
The delta y value.
deltaZ
Double
The delta z value.
uniformDelta
Double
The uniform delta value.

Return type

The resulting geometry.

Example

SELECT ST_Expand(
        ST_GeomFromWKT('POLYGON Z((50 50 1, 50 80 2, 80 80 3, 80 50 2, 50 50 1))'),
        10
   )
POLYGON Z((40 40 -9, 40 90 -9, 90 90 13, 90 40 13, 40 40 -9))