Name

ST_Translate — Translates a geometry a certain offset along the axis X,Y,Z

Synopsis

geometry ST_Translate(bytea Geometry, double Tx, double Ty, double Tz);

geometry ST_Translate(bytea Geometry, double Tx, double Ty);

Alias

Translate

Description

Translates a geometry a certain offset along the axis X,Y,Z

Transformation matrix

Equations to transform the vertices

[Note]

ST_Translate (geomA, Tx, Ty, Tz) is an abreviation for the method:

ST_Affine(geomA, 1, 0, 0, 0, 0, 1, 0, 0, 1, Tx, Ty, Tz)

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
----

Examples

SELECT ST_AsEWKT(ST_Translate(ST_GeomFromEWKT('LINESTRING (0 0, 1 1, 0 10)'),10,20));
--Result
LINESTRING (10 20, 11 21, 10 30)

SELECT ST_AsEWKT(ST_Translate(ST_GeomFromEWKT('POINT (1 2 3 4)'),10,20,30));
--Result
POINT (11 22 33 4)

--Same Translate With ST_Affine
SELECT ST_AsEWKT(ST_Affine(geomA, 1, 0, 0, 0, 0, 1, 0, 0, 1, Tx, Ty, Tz)) FROM 
(SELECT ST_GeomFromEWKT('POINT (1 2 3 4)') as geomA, 10 as Tx, 20 as Ty, 30 as Tz) as foo;  
--Result
POINT (11 22 33 4)

Related functions

ST_Affine