ST_AsEsriJSON takes a geometry column and returns the Esri JSON representation of the geometry as a string column.
Function | Syntax |
---|---|
Python | as |
SQL | ST |
Scala | as |
For more details, go to the GeoAnalytics Engine API reference for as_esri_json.
Examples
from geoanalytics.sql import functions as ST, Point
df = spark.createDataFrame([(Point(-178, -17),)], ["point"])
df.select(ST.as_esri_json("point").alias("as_esri_json")).show(truncate=False)
+------------------+
|as_esri_json |
+------------------+
|{"x":-178,"y":-17}|
+------------------+
Version table
Release | Notes |
---|---|
1.0.0 | Python and SQL functions introduced |
1.5.0 | Scala function introduced |