ST_GeogFromText — 从已知的文本表示或扩展 (WKT) 返回指定的地理值。
geography ST_GeogFromText(text EWKT);
从已知的文本或扩展的已知的表示中返回地理对象。 如果未指定,则假定为 SRID 4326。 这是 ST_GeographyFromText 的别名。 点始终以经纬度形式表示。
Add a WGS 84 geography point column to a table.
ALTER TABLE sometable ADD COLUMN geog geography(POINT, 4326);
Populate the geography column from longitude and latitude columns.
UPDATE sometable
SET geog = ST_GeogFromText('SRID=4326;POINT(' || lon || ' ' || lat || ')');
Specify a geography point using EPSG:4267, NAD27.
SELECT ST_GeogFromText('SRID=4267;POINT(-77.0092 38.889588)');
SRID=4267;POINT(-77.0092 38.889588)