ST_AsText takes a geometry column and returns the well-known text (WKT) representation of the geometry as a string column.
Function | Syntax |
---|---|
Python | as |
SQL | st |
Scala | as |
For more details, go to the GeoAnalytics for Microsoft Fabric API reference for as_text.
This function implements the OpenGIS Simple Features Implementation Specification for SQL 1.2.1
Examples
from geoanalytics_fabric.sql import functions as ST, Point
df = spark.createDataFrame([(Point(-178, -17),)], ["point"])
df.select(ST.as_text("point").alias("as_text")).show(truncate=False)
Result
+----------------+
|as_text |
+----------------+
|POINT (-178 -17)|
+----------------+
Version table
Release | Notes |
---|---|
1.0.0-beta | Python, SQL, and Scala functions introduced |