Geospatial Single-Table Predicate Syntax | Teradata Vantage - Geospatial Single-Table Predicate Syntax - Advanced SQL Engine - Teradata Database

Geospatial Data Types

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
ufo1590694251930.ditamap
dita:ditavalPath
ufo1590694251930.ditaval
dita:id
B035-1181
lifecycle
previous
Product Category
Teradata Vantageā„¢

Single-Table Predicate

For single-table predicates except distance methods ST_Distance and ST_3DDistance:

SELECT a, b FROM TableName WHERE {
  TableName.GeoCol.SupportedGeoMethod (GeospatialLiteralExpression) = 1 |
  GeospatialLiteralExpression.SupportedGeoMethod (TableName.GeoCol) = 1 |
  TableName.GeoCol IS NULL
}
The expression must be set to evaluate to 1 (true) for the first two forms to qualify as single-table predicates.

Single-Table Distance Predicate

For distance methods ST_Distance and ST_3DDistance:

SELECT a, b FROM TableName WHERE {
  TableName.GeoCol.SupportedGeoDistanceMethod (GeospatialLiteralExpression)
    { < | <= } DistanceLiteral |

  GeospatialLiteralExpression.SupportedGeoDistanceMethod(TableName.GeoCol)
    { < | <= } DistanceLiteral
}

Syntax Elements

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.