Constructs a geography object from a Well-Known Text (WKT) or Extended Well-Known Text (EWKT) string.
Syntax
geography ST_GeographyFromText(text eWKT);Parameters
| Parameter | Description |
|---|---|
eWKT | The WKT or EWKT string to parse. |
Usage notes
If the input string does not include a spatial reference identifier (SRID), the function uses the default SRID 4326.
Coordinates follow longitude-before-latitude order.
Examples
Construct a geography object using the default SRID 4326:
SELECT ST_SRID(ST_GeographyFromText('POINT(116 40)'));Output:
st_srid
---------
4326
(1 row)Construct a geography object with a specified SRID:
SELECT ST_SRID(ST_GeographyFromText('SRID=4256;POINT(116 40)'));Output:
st_srid
---------
4256
(1 row)该文章对您有帮助吗?