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
| Parameter | Description |
|---|---|
geomA | The input geometry object. |
deltaX | The translation offset applied to X coordinates. |
deltaY | The translation offset applied to Y coordinates. |
xFactor | The scale factor applied to X coordinates after translation. |
yFactor | The scale factor applied to Y coordinates after translation. |
Description
Additional behavior:
ST_TransScaleis available only for 2D objects.ST_TransScalesupports 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)该文章对您有帮助吗?