ST_AsText

Définition

ST_AsText accepte un objet ST_Geometry et retourne sa représentation textuelle connue.

Syntaxe

sde.st_astext (g1 sde.st_geometry)

Type de retour

Oracle

CLOB

PostgreSQL

Texte

Exemple

La fonction ST_AsText convertit le point de localisation hazardous_sites en description textuelle.

Oracle

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

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

SELECT site_id, name, sde.st_astext (location) 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),
                             location 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 (location) 
AS location
FROM hazardous_sites;

site_id      name                             location

   102    W. H. KleenareChemical Repository   POINT (1020.12000001 324.01999999)

7/10/2012