ST_PointZM

ST_PointZM takes four numeric columns or double values and returns a point column. The four numeric columns or values must contain the x,y,z coordinates and m-values 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 without m-values or z-coordinates use ST_Point. To create point geometries with only m-values or only z-coordinates use ST_PointM, ST_PointZ, or ST_MakePoint.

FunctionSyntax
Pythonpoint_zm(x,y,z,m,sr=None)
SQLST_PointZM(x,y,z,m,sr)
ScalapointZM(x,y,z,m,sr)

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

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, 10, 100)], ["longitude", "latitude", "z", "m"])

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