16.20 - Functions and Geospatial Data Types - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

Although Teradata Database implements the geospatial data types ST_Geometry and MBR as UDTs, they are neither distinct nor structured. The geospatial data types are Teradata proprietary internal UDTs (also called system defined types, or SDTs) and as such, are not useful as parameter types or the return type of an external routine.

An application that needs to pass geospatial values to an external routine can use any number of methods on an ST_Geometry or MBR type to get the entire representation or part of the representation as a data type that can be passed to an external routine.

IF a UDF needs … THEN pass the …
the entire representation of an ST_Geometry type in text format well-known text representation of the ST_Geometry value by calling the ST_AsText method.
the entire representation of an ST_Geometry type in binary format well-known binary representation of the ST_Geometry value by calling the ST_AsBinary method.
part of an ST_Geometry value, such as the X or Y coordinate of an ST_Point value by calling the appropriate method, such as ST_X or ST_Y.

For more information on geospatial types, including well-known text formats, well-known binary formats, methods, functions, and stored procedures, see Teradata Vantage™ - Geospatial Data Types , B035-1181 .