跳转至
Apache Sedona 1.9.0 已正式发布,新增 Spark 4.1 支持、proj4sedona 坐标系转换、Bing Tile 函数等众多特性!

ST_Scale

Introduction: This function scales the geometry to a new size by multiplying the ordinates with the corresponding scaling factors provided as parameters scaleX and scaleY.

Note

This function is designed for scaling 2D geometries. While it currently doesn't support scaling the Z and M coordinates, it preserves these values during the scaling operation.

ST_Scale

Format: ST_Scale(geometry: Geometry, scaleX: Double, scaleY: Double)

Return type: Geometry

Since: v1.7.0

SQL Example:

SELECT ST_Scale(
        ST_GeomFromWKT('POLYGON ((0 0, 0 1.5, 1.5 1.5, 1.5 0, 0 0))'),
       3, 2
)

Output:

POLYGON ((0 0, 0 3, 4.5 3, 4.5 0, 0 0))