15.10 - Geometry Types - Teradata Database

Teradata Database SQL Geospatial Types

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

SQL/MM Spatial supports the following geometry types:

 

Because Teradata Database UDTs do not support inheritance or subtyping, ST_Geometry is an instantiable type within Teradata Database. You can use ST_Geometry as the data type of a table column to represent any of the following geospatial types specified in the standard.

 

Type

Description

ST_Point

0-dimensional geometry that represents a single location in two-dimensional coordinate space.

ST_LineString

1-dimensional geometry usually stored as a sequence of points with a linear interpolation between points.

ST_Polygon

2-dimensional geometry consisting of one exterior boundary and zero or more interior boundaries, where each interior boundary defines a hole.

ST_GeomCollection

Collection of zero or more ST_Geometry values.

ST_MultiPoint

0-dimensional geometry collection where the elements are restricted to ST_Point values.

ST_MultiLineString

1-dimensional geometry collection where the elements are restricted to ST_LineString values.

ST_MultiPolygon

2-dimensional geometry collection where the elements are restricted to ST_Polygon values.

GeoSequence

Extension of ST_LineString that can contain tracking information, such as time stamps, in addition to geospatial information.

GeoSequence is a Teradata extension to SQL/MM Spatial.

Here is an example of a table definition that has an ST_Geometry column:

   CREATE TABLE sample_shapes (skey INTEGER, shape ST_Geometry);

Teradata Database also provides a UDT called MBR that provides a way to obtain the minimum bounding rectangle (MBR) of a geometry. The MBR UDT is a Teradata extension to SQL/MM Spatial.

ST_Geometry defines a method called ST_MBR that returns the MBR of a geometry. Consider the following table definition:

   CREATE TABLE sample_MBRs (skey INTEGER, shape_mbr MBR);
 

This example shows how to obtain the MBR of each geometry in the shape column of the sample_shapes table:

   INSERT INTO sample_MBRs
   SELECT skey, shape.ST_MBR() 
   FROM sample_shapes;
 

The ST_Geometry and MBR UDTs are defined in the SYSUDTLIB database.