ST_Point

更新时间:
复制 MD 格式

Constructs a 2D point geometry from x and y coordinates.

Syntax

geometry ST_Point(float xLon, float yLat)

Parameters

ParameterTypeDescription
xLonfloatThe x coordinate (longitude).
yLatfloatThe y coordinate (latitude).

Description

ST_Point constructs a point geometry containing only x and y coordinates. It is the Open Geospatial Consortium (OGC) standard equivalent of ST_MakePoint, which is defined in the OGC specification.

Use ST_MakePoint when you need 3D (Z) or 4D (ZM) points. Use ST_Point when OGC standards compliance is required or only 2D coordinates are needed.

Examples

Construct a point geometry

SELECT ST_AsText(ST_Point(116, 40));

Result:

   st_astext
---------------
 POINT(116 40)
(1 row)

The first argument is the longitude (116) and the second is the latitude (40).

What's next