ST_AsText

定义

ST_AsText 获取一个 ST_Geometry 对象,然后返回其可识别的文本表示。

语法

sde.st_astext (g1 sde.st_geometry)

返回类型

Oracle:CLOB

PostgreSQL:文本

示例

ST_AsText 函数将 hazardous_sites 位置点转换为文本描述。

Oracle

CREATE TABLE hazardous_sites (site_id integer,
                             name varchar(40),
                             loc sde.st_geometry);

INSERT INTO HAZARDOUS_SITES VALUES (
102,
'W. H. KleenareChemical Repository',
sde.st_geometry ('point (1020.12 324.02)', 0)
);

SELECT site_id, name, sde.st_astext (loc) Location
FROM HAZARDOUS_SITES;

SITE_ID      NAME                             Location

   102    W. H. KleenareChemical Repository   POINT (1020.12000000 324.02000000)

PostgreSQL

CREATE TABLE hazardous_sites (site_id integer,
                             name varchar(40),
                             loc sde.st_geometry);

INSERT INTO hazardous_sites VALUES (
102,
'W. H. KleenareChemical Repository',
sde.st_point ('point (1020.12 324.02)', 0)
);

SELECT site_id, name, sde.st_astext (loc) 
AS location
FROM hazardous_sites;

site_id      name                             location

   102    W. H. KleenareChemical Repository   POINT (1020.12000001 324.01999999)
9/15/2013