ST_PointFromShape takes a binary column and returns a point column. The input binary column must contain the
shapefile 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.
If a point cannot be created from the input binary 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_shape.
Examples
from geoanalytics_fabric.sql import functions as ST, Point
point_shape = bytearray(b'\x01\x00\x00\x00^\xbaI\x0c\x02\x03R\xc0L7\x89A`\xa5H\xc0')
df = spark.createDataFrame([(point_shape, )], ["shape"])
df.select(ST.point_from_shape("shape", sr=4326).alias("point_from_shape")).show(truncate=False)
Result
+-------------------------+
|point_from_shape |
+-------------------------+
|{"x":-72.047,"y":-49.292}|
+-------------------------+
Version table
Release | Notes |
---|---|
1.0.0-beta | Python, SQL, and Scala functions introduced |