Name

ST_Point — Creates a Point with the given coordinate values. Alias for ST_MakePoint.

Synopsis

geometry ST_Point(float x, float y);

geometry ST_Point(float x, float y, integer srid=unknown);

Description

Returns an Point with the given X and Y coordinate values. This is the SQL-MM alias for ST_MakePoint that takes just X and Y.

[Note]

For geodetic coordinates, X is longitude and Y is latitude

This method implements the SQL/MM specification. SQL-MM 3: 6.1.2

Examples: Geometry

SELECT ST_SetSRID( ST_Point( -71.104, 42.315), 4326)

Examples: Geography

SELECT CAST(ST_SetSRID( ST_Point( -71.104, 42.315), 4326) AS geography);

PostgreSQL also provides the :: short-hand for casting

SELECT ST_SetSRID( ST_Point( -71.104, 42.315), 4326)::geography;

If the point coordinates are not in a geodetic coordinate system (such as WGS84), then they must be reprojected before casting to a geography. In this example a point in Pennsylvania State Plane feet (SRID 2273) is projected to WGS84 (SRID 4326).

SELECT ST_Transform(ST_SetSRID( ST_Point( 3637510, 3014852 ), 2273), 4326)::geography;

See Also

Section 4.3, “Geography Data Type”, ST_MakePoint, ST_SetSRID, ST_Transform, ST_PointZ, ST_PointM, ST_PointZM