st_point function

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

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 value 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

-- 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

-- When invoking st_point with a literal for the SRID value, the output geometry type inherits the SRID value.
> SELECT typeof(st_point(10.0, 34.0, 4267));
  geometry(4267)