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

ST_Transform

Introduction:

Transform the Spatial Reference System / Coordinate Reference System of A, from SourceCRS to TargetCRS.

Since v1.9.0, Sedona supports multiple CRS formats including EPSG codes, WKT1, WKT2, PROJ strings, and PROJJSON. Grid files for high-accuracy datum transformations are also supported.

Tip

For comprehensive details on supported CRS formats, grid file usage, and examples, see the Spark SQL CRS Transformation documentation.

Note

By default, this function uses lat/lon order. You can use ST_FlipCoordinates to swap X and Y.

Format: ST_Transform (A:geometry, SourceCRS:string, TargetCRS:string)

Return type: Geometry

SQL example:

SELECT ST_Transform(polygondf.countyshape, 'epsg:4326','epsg:3857')
FROM polygondf

ST_Transform