ST_MPointFromEsriJSON takes a string column and returns a multipoint column. The input string column must contain the
Esri JSON representation of
multipoint geometries. You can optionally specify a spatial reference for the result multipoint column.
The sr parameter value must be a valid SRID or WKT string. Any SRID defined in the input strings will not be used.
If a multipoint cannot be created from the input string the function will return null.
| Function | Syntax |
|---|---|
| Python | mpoint |
| SQL | ST |
| Scala | m |
For more details, go to the GeoAnalytics for Microsoft Fabric API reference for mpoint_from_esri_json.
Examples
from geoanalytics_fabric.sql import functions as ST
mpoint_esri_json = '{"points": [[1.231,6.149],[1.230,6.149],[1.240,6.152],[1.242,6.153]]}'
df = spark.createDataFrame([(mpoint_esri_json, )], ["esri_json"])
df.select(ST.mpoint_from_esri_json("esri_json", sr=4326).alias("mpoint_from_esri_json")).show(truncate=False)+------------------------------------------------------------------+
|mpoint_from_esri_json |
+------------------------------------------------------------------+
|{"points":[[1.231,6.149],[1.23,6.149],[1.24,6.152],[1.242,6.153]]}|
+------------------------------------------------------------------+Version table
| Release | Notes |
|---|---|
1.0.0-beta | Python, SQL, and Scala functions introduced |