Geospatial Single-Table Predicates | Geospatial Data Types | Teradata Vantage - Geospatial Single-Table Predicates - Advanced SQL Engine - Teradata Database

Geospatial Data Types

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
vci1556127188517.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1181
lifecycle
previous
Product Category
Teradata Vantageā„¢
Geospatial single-table predicates cause the optimizer to evaluate a geospatial index, if one exists, as a potential access path to the geospatial data. In these circumstances, the index can greatly speed access to the data and execution of the query. Supported single-table predicates, excluding the distance methods ST_Distance and ST_3DDistance, use any of the following forms:
SELECT a, b FROM TableName
WHERE TableName.GeoCol.SupportedGeoMethod(GeospatialLiteralExpression)=1
or
SELECT a, b FROM TableName
WHERE GeospatialLiteralExpression.SupportedGeoMethod(TableName.GeoCol) = 1
The expression must be set to evaluate to 1 (true) for these to qualify as a single-table predicates.
or
SELECT a, b, FROM  TableName
WHERE TableName.GeoCol IS NULL
Single-table distance predicates are those that use the ST_Distance and ST_3DDistance methods. They can use any of the following forms:
SELECT a, b FROM TableName
WHERE TableName.GeoCol.
SupportedGeoDistanceMethod(GeospatialLiteralExpression) < DistanceLiteral
or
SELECT a, b FROM TableName
WHERE GeospatialLiteralExpression.
SupportedGeoDistanceMethod(TableName.GeoCol) < DistanceLiteral
You can use either the < or <= operator to form these predicates.
Syntax Element Description
TableName Table containing a geospatial data column.
GeoCol Geospatial data column defined as one of the ST_GEOMETRY types.
SupportedGeoMethod One of the geospatial methods listed above, excluding ST_Distance and ST_3DDistance.
SupportedGeoDistanceMethod Either ST_Distance or ST_3DDistance.
GeospatialLiteralExpression An arbitrary geospatial literal expression that can be folded (simplified) in to a geospatial literal value.
DistanceLiteral A floating point value representing a distance.