Skip to main content
Returns the input geometry with its X, Y and Z coordinates (if present in the geometry) translated by deltaX, deltaY and deltaZ (if specified) If the geometry is 2D, and a deltaZ parameter is specified, no change is done to the Z coordinate of the geometry and the resultant geometry is also 2D. If the geometry is empty, no change is done to it. If the given geometry contains sub-geometries (GEOMETRY COLLECTION, MULTI POLYGON/LINE/POINT), all underlying geometries are individually translated. ST_Translate

Signatures

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

Parameters

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

Return type

The resulting geometry.

Examples

SELECT ST_Translate(ST_GeomFromText('GEOMETRYCOLLECTION(MULTIPOLYGON(((3 2,3 3,4 3,4 2,3 2)),((3 4,5 6,5 7,3 4))), POINT(1 1 1), LINESTRING EMPTY)'), 2, 2, 3)
GEOMETRYCOLLECTION (MULTIPOLYGON (((5 4, 5 5, 6 5, 6 4, 5 4)), ((5 6, 7 8, 7 9, 5 6))), POINT (3 3), LINESTRING EMPTY)
SELECT ST_Translate(ST_GeomFromText('POINT(-71.01 42.37)'),1,2)
POINT (-70.01 44.37)