Constructs a 2D point geometry from x and y coordinates.
Syntax
geometry ST_Point(float xLon, float yLat)Parameters
| Parameter | Type | Description |
|---|---|---|
xLon | float | The x coordinate (longitude). |
yLat | float | The 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
ST_MakePoint — constructs 2D, 3DZ, or 4D points
该文章对您有帮助吗?