ST_TransScale

更新时间:
复制 MD 格式

Translates a geometry by deltaX and deltaY, then scales it by xFactor and yFactor, operating on X and Y coordinates only.

Syntax

geometry ST_TransScale(geometry geomA, float deltaX, float deltaY, float xFactor, float yFactor);

Parameters

ParameterDescription
geomAThe input geometry object.
deltaXThe translation offset applied to X coordinates.
deltaYThe translation offset applied to Y coordinates.
xFactorThe scale factor applied to X coordinates after translation.
yFactorThe scale factor applied to Y coordinates after translation.

Description

Additional behavior:

  • ST_TransScale is available only for 2D objects.

  • ST_TransScale supports 3D objects and does not delete Z coordinates.

  • Supports circular strings and curves.

Examples

Basic example

SELECT ST_AsEWKT(ST_TransScale(ST_GeomFromText('LINESTRING(2 1,1 1)',4326),1,1,2,2));

Output:

           st_asewkt
-------------------------------
 SRID=4326;LINESTRING(6 4,4 4)
(1 row)