ST_MakePoint

ST_MakePoint takes two numeric columns and returns a point column. The two input columns must contain the x,y coordinates of the points respectively. You can optionally specify two additional input columns with z-coordinates and m-values. The spatial reference of the result column will always be 0 and should be set to a valid ID using ST_SRID.

FunctionSyntax
Pythonmake_point(x, y, z=None, m=None)
SQLST_MakePoint(x, y, z, m)
ScalamakePoint(x, y, z, m)

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

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

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, -17, 10, 100)], ["x", "y", "z", "m"])

df.select(ST.make_point(x="x",y="y",z="z",m="m").alias("make_point")).show(truncate=False)
Result
Use dark colors for code blocksCopy
1
2
3
4
5
+---------------------------------+
|make_point                       |
+---------------------------------+
|{"x":-178,"y":-17,"z":10,"m":100}|
+---------------------------------+

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.