Geospatial Formats, Transforms, Loading, and Unloading | Teradata Vantage - 17.10 - Geospatial Formats, Transforms, Loading, and Unloading - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Geospatial Data Types

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

SQL/MM Spatial defines a well-known text (WKT) and a well-known binary (WKB) representation for each geospatial type. For details on WKT and WKB formats, see Geospatial Data Formats.

Teradata provides several different "transform groups" for geospatial data that can automatically convert the data to different types and formats during load/import and unload/export operations between Vantage and client applications. The default transform group exports and imports geospatial data as CLOB types in the WKT format.

By default, client applications can load geospatial data into Vantage by passing a CLOB value in the WKT format. Applications that accept geospatial data in the WKT format can select directly from an ST_Geometry column. By default, the data type returned is a CLOB.

Applications that require geospatial data in the WKB format can select directly from a ST_Geometry column using the ST_AsBinary() method. The data type returned is a BLOB.

For client applications that use geospatial data in other types and formats, you can optionally use one of the other ST_Geospatial transforms that Teradata supplies. For more information about geospatial transform groups, see ST_Geometry Type Transforms.

Vantage also defines ST_Geometry constructors and functions that client applications can call, passing in a WKT or WKB representation of a geospatial type and getting an ST_Geometry value as a result.

TDGeoImport and TDGeoExport Utilities

TDGeoImport and TDGeoExport are utilities that Teradata provides to interconvert between the database representation of geospatial data and formats compatible with the ESRI, MapInfo, and TIGER/Line data formats. For more information on these utilities, see Teradata® Geospatial Utilities User Guide, B035-2519.

Example: Inserting a Point Value into an ST_Geometry Column

Consider the previous definition of the sample_shapes table. The following example inserts a point value into the shape column using the WKT representation of a point:

INSERT INTO sample_shapes
VALUES (1001, 'POINT(10 20)');