ST_ASGEOJSON (Lakehouse v1)
Converts a GEOMETRY object into a GeoJSON representation.
SQL Syntax
Section titled “SQL Syntax”ST_ASGEOJSON(<geometry>)Arguments
Section titled “Arguments”| Arguments | Description |
|---|---|
<geometry> | The argument must be an expression of type GEOMETRY. |
Return Type
Section titled “Return Type”Variant.
SQL Examples
Section titled “SQL Examples”SELECT ST_ASGEOJSON( ST_GEOMETRYFROMWKT( 'SRID=4326;LINESTRING(400000 6000000, 401000 6010000)' ) ) AS pipeline_geojson;
┌─────────────────────────────────────────────────────────────────────────┐│ pipeline_geojson │├─────────────────────────────────────────────────────────────────────────┤│ {"coordinates":[[400000,6000000],[401000,6010000]],"type":"LineString"} │└─────────────────────────────────────────────────────────────────────────┘