ST_Point

ST_Point takes two numeric columns or double values and returns a point column. The two numeric columns or values must contain the x,y coordinates of the 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.

To create point geometries with a z-coordinate and/or m-value, use ST_PointZ, ST_PointZM, ST_PointM, or ST_MakePoint.

FunctionSyntax
Pythonpoint(x, y, sr=None)
SQLST_Point(x, y, sr)
Scalapoint(x, y, sr)

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

Examples

PythonPythonSQLScala
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
from geoanalytics.sql import functions as ST

df = spark.createDataFrame([(-178.0, -17.0)], ["longitude", "latitude"])

df.select(ST.point("longitude", "latitude", sr=4326).alias("point")).show()
Result
Use dark colors for code blocksCopy
1
2
3
4
5
+------------------+
|             point|
+------------------+
|{"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.