Geospatial Formats, Transforms, Loading, and Unloading

Teradata Vantage™ Geospatial Data Types

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1181-162K

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 Teradata Database 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 Teradata Database 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.

Teradata Database 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)');