15.10 - ST_GeomFromText - Teradata Database

Teradata Database SQL Geospatial Types

prodname
Teradata Database
vrm_release
15.10
category
Programming Reference
featnum
B035-1181-151K

User-defined function that returns a specified ST_Geometry value.

 

Argument …

Specifies …

awkt

a VARCHAR(64000) for the well-known text (WKT) representation of the spatial type. The size of awkt cannot exceed 64000 bytes.

When a WKT representation is larger than 64000 bytes, use the ST_Geometry constructor method (CLOB version).

For details on WKT formats, see “Well-Known Text Representation” on page 194.

asrid

an optional INTEGER for a spatial reference system identifier.

If this argument is omitted, the spatial reference system identifier is set to 0.

Returns an ST_Geometry value.

For best performance, use the ST_Geometry constructor method instead of this UDF.

The ST_GeomFromText UDF does not support system time information, so times for geosequence types are not automatically adjusted for the system or session time zone. For geosequence types, you should use the constructor method instead of this UDF.

CREATE TABLE varchar_tab1 (a int, b VARCHAR (60000));
INSERT INTO varchar_tab1 VALUES (1001, 'Point(10 20 30)');
 
CREATE TABLE sample_shapes(skey INTEGER, shape ST_Geometry);
INSERT INTO sample_shapes
SELECT a, SYSSPATIAL.ST_GeomFromText(b) FROM varchar_tab1;
 
SELECT * FROM sample_shapes;