PostGISAffine Transformations

ST_Translate

What is ST_Translate?

ST_Translate is a PostGIS function that shifts every vertex of the input geometry by the supplied X, Y, and optionally Z offsets. It does not rotate, scale, or distort — just a rigid translation.

SQL
1ST_Translate(geometry g1, float deltax, float deltay)geometry
2ST_Translate(geometry g1, float deltax, float deltay, float deltaz)geometry

Offsets are in the units of the input's SRID.

When would you use ST_Translate?

Use ST_Translate for simple coordinate shifts — placing a feature at a new origin, implementing feature placement in layouts, or offsetting a label geometry away from its anchor. It is also the most common way to apply relative placement during pre/post multiplication of other affine transforms.

SQL
1-- Nudge labels 5 metres east and 3 metres north:
2SELECT ST_Translate(label_geom, 5, 3) FROM label_anchors;

FAQs

Does ST_Translate respect SRID units?

Offsets are in the same units as the input's SRID — metres for most projected CRSs, degrees for EPSG:4326. To translate by a known metre distance on lat/lon data, reproject first or convert metres to degrees manually (noting that this conversion varies with latitude).

Can I translate by a vector stored as a geometry?

Not directly — ST_Translate takes scalar offsets. Extract them with ST_X(pt) and ST_Y(pt) and pass as arguments, or use ST_Affine where the translation vector comes as three coefficients.

What happens on geographic coordinates at high latitudes?

Because a degree of longitude is much shorter near the poles, translating an EPSG:4326 geometry by a fixed degree offset produces very different metre shifts at different latitudes. For realistic metre-based shifts, reproject to a local projected CRS.

Does ST_Translate modify the SRID?

No. The SRID is preserved. A translated geometry is considered to be in the same CRS, even though the logical meaning of those coordinates has changed — be deliberate about whether that's appropriate for your workflow.