Skip to content
🎉 Apache Sedona 1.8.1 is now available! Check out the new features and improvements.

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)

SQL example:

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