ST_PointFromBinary

ST_PointFromBinary takes a binary column and returns a point column. The input binary column must contain the well-known binary (WKB) 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.

FunctionSyntax
Pythonpoint_from_binary(wkb,sr=None)
SQLST_PointFromBinary(wkb,sr)
ScalapointFromBinary(wkb,sr)

For more details, go to the GeoAnalytics Engine API reference for point_from_binary.

This function implements the OpenGIS Simple Features Implementation Specification for SQL 1.2.1

Examples

PythonPythonSQLScala
1
2
3
4
5
6
7
8

from geoanalytics.sql import functions as ST

point_binary = bytearray(b'\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00@f\xc0\x00\x00\x00\x00\x00\x001\xc0')

df = spark.createDataFrame([(point_binary,)], ["wkb"])

df.select(ST.point_from_binary("wkb", sr=4326).alias("point_from_binary")).show()
Result
1
2
3
4
5
+------------------+
| point_from_binary|
+------------------+
|{"x":-178,"y":-17}|
+------------------+

Version table

ReleaseNotes

1.0.0

Python and SQL functions introduced

1.5.0

Scala function introduced

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close