Constructs a geography object from a Well-Known Text (WKT) or Extended Well-Known Text (EWKT) string.
Syntax
geography ST_GeogFromText(text eWKT);Parameters
| Parameter | Description |
|---|---|
eWKT | The WKT or EWKT string. |
Description
If no spatial reference identifier (SRID) is specified, the default SRID 4326 is used.
ST_GeogFromTextis equivalent toST_GeographyFromText.Point coordinates follow longitude-before-latitude order.
Examples
Construct a geography object using the default SRID 4326:
SELECT ST_SRID(ST_GeogFromText('POINT(116 40)'));
st_srid
---------
4326
(1 row)Construct a geography object using a specified SRID:
SELECT ST_SRID(ST_GeogFromText('SRID=4256;POINT(116 40)'));
st_srid
---------
4256
(1 row)该文章对您有帮助吗?