Skip to main content

st_point function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 17.1 and above

Preview

This feature is in Public Preview.

note

This feature is not available on Databricks SQL Classic warehouses. To learn more about Databricks SQL warehouses, see SQL warehouse types

Returns a point GEOMETRY with the given x and y coordinates and SRID value, if provided.

Syntax

st_point ( x, y [, srid] )

Arguments

  • x: A DOUBLE value, representing the first coordinate of a point.
  • y: A DOUBLE value, representing the second coordinate of a point.
  • srid: The optional SRID value of the point. Default is 0.

Returns

A value of type GEOMETRY, representing a point with the specified coordinates.

The function returns NULL if any of the inputs is NULL.

Examples

SQL
-- Creates a point with coordinates (10, 34) and default SRID 0.
> SELECT st_astext(st_point(10.0, 34.0));
POINT(10 34)
-- Returns the SRID of a point created with default SRID.
> SELECT st_srid(st_point(10.0, 34.0));
0
-- Creates a point with coordinates (10, 34) and SRID 3857.
> SELECT st_srid(st_point(10.0, 34.0, 3857));
3857