This topic describes the ST_Translate function. This function returns a new geometry object whose coordinates are offset by the specified units.

Syntax

geometry ST_Translate(geometry  g1 , float  deltax , float  deltay);
geometry  ST_Translate(geometry  g1 , float  deltax , float  deltay , float  deltaz);

Parameters

Parameter Description
g1 The geometry object that you want to specify.
deltax The offset units of the delta x.
deltay The offset units of the delta y.
deltaz The offset units of the delta z.

Description

  • The specified units are based on the units that are defined in spatial reference identifier (SRID) of the geometry object.
  • The ST_Translate function supports 3D objects and does not delete z coordinates.
  • The ST_Translate function supports circular strings and curves.

Examples

SELECT ST_AsEWKT(ST_Translate(ST_GeomFromText('LINESTRING(2 1,1 1)',4326),1,1));
           st_asewkt
-------------------------------
 SRID=4326;LINESTRING(3 2,2 2)
(1 row)