名前

ST_GeogFromText — Well-Known Text表現または拡張WKTから指定したジオグラフィ値を返します。

概要

geography ST_GeogFromText(text EWKT);

説明

Well-Known Text表現または拡張WKTから指定したジオグラフィ値を返します。SRID 4326を仮定します。この関数はST_GeographyFromTextの別名です。ポイントは常に経度緯度形式で表現されます。

Add a WGS 84 geography point column to a table.

Code
ALTER TABLE sometable ADD COLUMN geog geography(POINT, 4326);

Populate the geography column from longitude and latitude columns.

Code
UPDATE sometable
SET geog = ST_GeogFromText('SRID=4326;POINT(' || lon || ' ' || lat || ')');

Specify a geography point using EPSG:4267, NAD27.

Code
SELECT ST_GeogFromText('SRID=4267;POINT(-77.0092 38.889588)');
出力:
SRID=4267;POINT(-77.0092 38.889588)
Figure
Geometry figure for visual-st-geogfromtext-01