ST_MPointFromText takes a string column and returns a multipoint column.
The string column must contain the well-known text (WKT)
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.
Function | Syntax |
---|---|
Python | mpoint |
SQL | ST |
Scala | mpoint |
For more details, go to the GeoAnalytics for Microsoft Fabric API reference for mpoint_from_text.
This function implements the OpenGIS Simple Features Implementation Specification for SQL 1.2.1.
Examples
from geoanalytics_fabric.sql import functions as ST
mpoint_wkt = 'MULTIPOINT (-72.047 -49.292, -72.654 -49.136, -71.921 -49.124, -72.445 -49.026)'
df = spark.createDataFrame([(mpoint_wkt,)], ["wkt"])
df.select(ST.mpoint_from_text("wkt", sr=4326).alias("mpoint_from_text")).show(truncate=False)
Result
+------------------------------------------------------------------------------------+
|mpoint_from_text |
+------------------------------------------------------------------------------------+
|{"points":[[-72.047,-49.292],[-72.654,-49.136],[-71.921,-49.124],[-72.445,-49.026]]}|
+------------------------------------------------------------------------------------+
Version table
Release | Notes |
---|---|
1.0.0-beta | Python, SQL, and Scala functions introduced |