跳转至
🎉 SedonaDB 0.4.0 已正式发布!🗺️ 新增 Python DataFrame API、R dplyr 接口、Geography 支持及 GPU 加速空间连接。阅读发布博客 →

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