st_point 函数

适用于:已勾选“是”的 Databricks Runtime 17.1 及更高版本

Important

此功能目前以公共预览版提供。

返回具有给定 x 和 y 坐标和 SRID 值的点 GEOMETRY (如果提供)。

Syntax

st_point ( x, y [, srid] )

Arguments

  • x:一个 DOUBLE 值,表示点的第一个坐标。
  • y:一个 DOUBLE 值,表示点的第二个坐标。
  • srid:点的可选 SRID 值。 默认为 0。

Returns

类型的 GEOMETRY值,表示具有指定坐标的点。

如果任何输入为NULL,该函数将返回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