Skip to content
🎉 Apache Sedona 1.8.1 is now available! Check out the new features and improvements.

ST_Expand

Introduction: 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.

Note

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.

Format:

ST_Expand(geometry: Geometry, uniformDelta: Double)

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

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

Since: v1.6.1

SQL Example:

SELECT ST_Expand(
        ST_GeomFromWKT('POLYGON Z((50 50 1, 50 80 2, 80 80 3, 80 50 2, 50 50 1))'),
        10
   )

Output:

POLYGON Z((40 40 -9, 40 90 -9, 90 90 13, 90 40 13, 40 40 -9))