Skip to content

ST_TRANSLATE

Translates a GEOGRAPHY object by applying specified offsets to its coordinates.

See also:

Syntax

sql
ST_TRANSLATE(<input>, <offset_x>, <offset_y>)

Arguments

  • <input>: A GEOGRAPHY object to translate.
  • <offset_x>: A FLOAT8 value representing the offset to apply to the x-coordinates.
  • <offset_y>: A FLOAT8 value representing the offset to apply to the y-coordinates.

Returns

Returns a GEOGRAPHY of the same type as the input, with its coordinates translated by the specified delta values.

Example

sql
SELECT ST_AsText(ST_TRANSLATE('POINT(1 1)'::GEOGRAPHY, 10, -5));
-- 'POINT(11 -4)'

SELECT ST_AsText(ST_TRANSLATE('LINESTRING(0 0, 1 1)'::GEOGRAPHY, 2, 3));
-- 'LINESTRING(2 3, 3 4)'