ST_MPointFromBinary takes a binary column and returns a multipoint column.
The input binary column must contain the
well-known binary (WKB)
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.
If a multipoint cannot be created from the input binary the function will return null
.
Function | Syntax |
---|---|
Python | mpoint |
SQL | ST |
Scala | mpoint |
For more details, go to the GeoAnalytics for Microsoft Fabric API reference for mpoint_from_binary.
This function implements the OpenGIS Simple Features Implementation Specification for SQL 1.2.1.
Examples
from geoanalytics_fabric.sql import functions as ST
mpoint_binary= bytearray(b'\x01\x04\x00\x00\x00\x03\x00\x00\x00\x01\x01\x00\x00\x00\xc3\xf5(\\\xc1\x1bH\xc1\x00\x00\x00\xf03>_A\x01\x01\x00\x00\x00H\xe1z\xf4z=G\xc1\x00\x00\x00\xf03>_A\x01\x01\x00\x00\x00R\xb8\x1e%\xb4RH\xc1\xaeG\xe1zO\xe9^A')
df = spark.createDataFrame([(mpoint_binary,)], ["wkb"])
df.select(ST.mpoint_from_binary("wkb", sr=54008).alias("mpoint_from_binary")).show(truncate=False)
+---------------------------------------------------------------------------------------+
|mpoint_from_binary |
+---------------------------------------------------------------------------------------+
|{"points":[[-3159938.72,8190159.75],[-3046133.91,8190159.75],[-3188072.29,8103229.92]]}|
+---------------------------------------------------------------------------------------+
Version table
Release | Notes |
---|---|
1.0.0-beta | Python, SQL, and Scala functions introduced |