ArcGIS Server Banner

ST_AsText

ST_AsText

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback
Note: This topic was updated for 9.3.1.

Definition

ST_AsText takes an ST_Geometry object and returns its well-known text representation.

Syntax

Oracle

sde.st_astext (g1 sde.st_geometry)

PostgreSQL

st_astext (g1 st_geometry)

Return type

Oracle

CLOB

PostgreSQL

Text

Example

The ST_AsText function converts the hazardous_sites location point into its text description.

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 st_geometry);

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

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

SITE_ID      NAME                             Location

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

See Also

  • An overview of SQL functions used with ST_Geometry types