ST_PointFromEsriJSON takes a string column and returns a point column. The input string column must contain the
Esri JSON representation of
point geometries. You can optionally specify a spatial reference for the result point column.
The sr
parameter value must be a valid SRID or WKT string. Any SRID defined in the input Esri JSON strings will not be used.
If a point cannot be created from the input string the function will return null
.
Function | Syntax |
---|---|
Python | point |
SQL | ST |
Scala | point |
For more details, go to the GeoAnalytics for Microsoft Fabric API reference for point_from_esri_json.
Examples
from geoanalytics_fabric.sql import functions as ST
df = spark.createDataFrame([('{"x":-178.0,"y":-17.0}', )], ["esri_json"])
df.select(ST.point_from_esri_json("esri_json", srid=4326).alias("point_from_esri_json")).show(truncate=False)
+--------------------+
|point_from_esri_json|
+--------------------+
|{"x":-178,"y":-17} |
+--------------------+
Version table
Release | Notes |
---|---|
1.0.0-beta | Python, SQL, and Scala functions introduced |