Skip to content
πŸŽ‰ SedonaDB 0.4.0 is out now! πŸ—ΊοΈ Python DataFrame API, R dplyr, Geography support & GPU-accelerated spatial joins. Read the release blog β†’

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